[ https://issues.apache.org/jira/browse/FELIX-5501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15938976#comment-15938976 ]
Nikolas Falco commented on FELIX-5501: -------------------------------------- I create a patch. You can see difference on github branch [https://github.com/nfalco79/maven-bundle-plugin/pull/1] > Pom dependency are not reduced when embedding is inline > ------------------------------------------------------- > > Key: FELIX-5501 > URL: https://issues.apache.org/jira/browse/FELIX-5501 > Project: Felix > Issue Type: Bug > Components: Maven Bundle Plugin > Affects Versions: maven-bundle-plugin-3.2.0 > Environment: Maven 3.3.9 > Windows OS > Reporter: Nikolas Falco > Attachments: FELIX-5501.patch > > > Looking the code (DependencyEmbedder#processDependencies) seems that pom > reduction is not performed when embedding is marked as inline. > Let me explain with use cases. > *Use case 1 (inline)* > I would embed a third party (for example commons-io) dependency inline into > my project P1 means that all commons-io classes are placed into the P1.jar. > Classes are visible throught export package manifest header in a OSGi > environment and to the compiler at compile time (javac). > When I build with maven a project P2 that has P1 as dependency, maven lookup > also P1 dependencies, so in the classpath I have (P1 + commons-io) classes > from P1 jar and commons-io classes again from commons-io jar. _Duplicate > classes in classpath_. > I think that this is the use case that more benefits from pom reduction. > *Use case 2 (not inline)* > I would embed a third party (for example commons-lang) dependency into my > project P1 as jar in a _lib/_ folder that means commons-lang.jar is placed as > nested jar of the P1.jar and it is added to Bundle-Classpath manifest header. > Classes are visible throught export package manifest header in a OSGi > environment but *NO* to the compiler at compile time (javac) because it's a > jar into jar. > When I build with maven a project P2 that has P1 as dependency, maven looks > also for P1 dependencies (empty because stripped by reduction), so I have in > the classpath only P1 classes from P1 jar and no commons-lang classes so > build fails. > So I think that this is the use case that have should no benefit of pom > reduction. > Seems the actual behaviour is reversed or at least should be performed also > in inline use case -- This message was sent by Atlassian JIRA (v6.3.15#6346)