You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by mc...@apache.org on 2009/07/13 12:59:40 UTC

svn commit: r793541 - in /felix/trunk/bundleplugin: pom.xml src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java

Author: mcculls
Date: Mon Jul 13 10:59:39 2009
New Revision: 793541

URL: http://svn.apache.org/viewvc?rev=793541&view=rev
Log:
FELIX-1262: remove duplicate resource entries to avoid Bnd Tool error (it suffixes duplicate entries with ~ and then can't find a file with that name)

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

Modified: felix/trunk/bundleplugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/pom.xml?rev=793541&r1=793540&r2=793541&view=diff
==============================================================================
--- felix/trunk/bundleplugin/pom.xml (original)
+++ felix/trunk/bundleplugin/pom.xml Mon Jul 13 10:59:39 2009
@@ -28,7 +28,7 @@
  <modelVersion>4.0.0</modelVersion>
 
  <artifactId>maven-bundle-plugin</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.0.1-SNAPSHOT</version>
  <packaging>maven-plugin</packaging>
  
  <name>Maven Bundle Plugin</name>

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=793541&r1=793540&r2=793541&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 Mon Jul 13 10:59:39 2009
@@ -36,6 +36,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 
@@ -975,7 +976,7 @@
     {
         final String basePath = project.getBasedir().getAbsolutePath();
 
-        StringBuffer resourcePaths = new StringBuffer();
+        Set pathSet = new LinkedHashSet();
         for ( Iterator i = project.getResources().iterator(); i.hasNext(); )
         {
             org.apache.maven.model.Resource resource = ( org.apache.maven.model.Resource ) i.next();
@@ -1041,25 +1042,27 @@
                         path = targetPath + '/' + path;
                     }
 
-                    if ( resourcePaths.length() > 0 )
-                    {
-                        resourcePaths.append( ',' );
-                    }
-
+                    // use Bnd filtering?
                     if ( resource.isFiltering() )
                     {
-                        resourcePaths.append( '{' );
-                        resourcePaths.append( path );
-                        resourcePaths.append( '}' );
-                    }
-                    else
-                    {
-                        resourcePaths.append( path );
+                        path = '{' + path + '}';
                     }
+
+                    pathSet.add( path );
                 }
             }
         }
 
+        StringBuffer resourcePaths = new StringBuffer();
+        for ( Iterator i = pathSet.iterator() ; i.hasNext(); )
+        {
+            resourcePaths.append( i.next() );
+            if ( i.hasNext() )
+            {
+                resourcePaths.append( ',' );
+            }
+        }
+
         return resourcePaths.toString();
     }