felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r465705 - in /incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main: java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java resources/META-INF/plexus/components.xml
Date Thu, 19 Oct 2006 18:03:13 GMT
Author: rickhall
Date: Thu Oct 19 11:03:12 2006
New Revision: 465705

URL: http://svn.apache.org/viewvc?view=rev&rev=465705
Log:
Applied patch (FELIXM2-5) for dealing with inter-bundle transitive
dependencies.

Modified:
    incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java
    incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/resources/META-INF/plexus/components.xml

Modified: incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java?view=diff&rev=465705&r1=465704&r2=465705
==============================================================================
--- incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java
(original)
+++ incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/java/org/apache/felix/tools/maven/plugin/OsgiJarMojo.java
Thu Oct 19 11:03:12 2006
@@ -629,6 +629,7 @@
 	 */
 	private void addEmbeddedJars() throws MojoExecutionException {
 		Set artifacts = project.getArtifacts();
+		Map artifactMap = ArtifactUtils.artifactMapByArtifactId( artifacts );
 
 		for (Iterator it = artifacts.iterator(); it.hasNext();) {
 			Artifact artifact = (Artifact) it.next();
@@ -639,6 +640,25 @@
 				if ("jar".equals(type)) {
                     // Do not include artifacts which are inlined
                     if (!(inlinedArtifacts.contains(artifact.getArtifactId()))) {
+                      
+                        // Do not include artifacts provided by another bundle
+                        boolean isProvidedByBundle = false;
+                        Iterator iter = artifact.getDependencyTrail().iterator();
+                        iter.next(); // skip this project
+                        while ( iter.hasNext() )
+                        {  
+                            String id = (String) iter.next();
+                            Artifact element = (Artifact) artifactMap.get( id );
+                            if ( element != null 
+                                    && "osgi-bundle".equals( element.getType() )
)
+                            {
+                                isProvidedByBundle = true;
+                                break;
+                            }
+                        }
+                        if ( isProvidedByBundle )
+                            continue;
+                        
                         File depFile = artifact.getFile();
 
                         try {

Modified: incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=465705&r1=465704&r2=465705
==============================================================================
--- incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++ incubator/felix/trunk/tools/maven2/maven-osgi-plugin/src/main/resources/META-INF/plexus/components.xml
Thu Oct 19 11:03:12 2006
@@ -30,7 +30,6 @@
       <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
       <configuration>
         <type>osgi-bundle</type>
-        <includesDependencies>true</includesDependencies>
         <language>java</language>
         <extension>jar</extension>
         <addedToClasspath>true</addedToClasspath>



Mime
View raw message