felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1139605 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Date Sat, 25 Jun 2011 19:53:51 GMT
Author: mcculls
Date: Sat Jun 25 19:53:50 2011
New Revision: 1139605

URL: http://svn.apache.org/viewvc?rev=1139605&view=rev
Log:
FELIX-1985: warn when duplicate paths appear in Include-Resource

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=1139605&r1=1139604&r2=1139605&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Sat Jun 25 19:53:50 2011
@@ -297,18 +297,33 @@ public class BundlePlugin extends Abstra
             List errors = builder.getErrors();
             List warnings = builder.getWarnings();
 
+            String warningPrefix = "Warning building bundle " + currentProject.getArtifact()
+ " : ";
             for ( Iterator w = warnings.iterator(); w.hasNext(); )
             {
                 String msg = ( String ) w.next();
-                getLog().warn( "Warning building bundle " + currentProject.getArtifact()
+ " : " + msg );
+                getLog().warn( warningPrefix + msg );
             }
+
+            boolean hasErrors = false;
+            String errorPrefix = "Error building bundle " + currentProject.getArtifact()
+ " : ";
+            String fileNotFound = "Input file does not exist: ";
             for ( Iterator e = errors.iterator(); e.hasNext(); )
             {
                 String msg = ( String ) e.next();
-                getLog().error( "Error building bundle " + currentProject.getArtifact() +
" : " + msg );
+                if ( msg.startsWith( fileNotFound ) && msg.endsWith( "~" ) )
+                {
+                    // treat as warning; this error happens when you have duplicate entries
in Include-Resource
+                    String duplicate = Processor.removeDuplicateMarker( msg.substring( fileNotFound.length()
) );
+                    getLog().warn( warningPrefix + "Duplicate path '" + duplicate  + "' in
Include-Resource" );
+                }
+                else
+                {
+                    getLog().error( errorPrefix + msg );
+                    hasErrors = true;
+                }
             }
 
-            if ( errors.size() > 0 )
+            if ( hasErrors )
             {
                 String failok = builder.getProperty( "-failok" );
                 if ( null == failok || "false".equalsIgnoreCase( failok ) )



Mime
View raw message