[ 
https://issues.apache.org/jira/browse/FELIX-5074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14956325#comment-14956325
 ] 

Konrad Windszus commented on FELIX-5074:
----------------------------------------

Hi Pierre,
thanks for testing. Usually you depend on the minimal version of a dependency 
you need. If felix.scr.bnd is still compatible with bndlib 2.1.0 you should 
still depend on exactly that version. Only if scr.bnd depends on some bndlib 
3.0.0 only features you should increase that dependency. Otherwise you detect 
incompatibilities only at run time and not at compile time (e.g. if you 
leverage new methods being added in 3.0.0). If you still want to increase the 
dependency to bndlib 3.0.0 please clearly state, that this plugin is only 
compatible with bnd 3+.
Thanks in advance for applying my patch.
Konrad

> Using org.apache.felix.scr.bnd together with maven-bundle-plugin leads to 
> using the wrong bnd version
> -----------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5074
>                 URL: https://issues.apache.org/jira/browse/FELIX-5074
>             Project: Felix
>          Issue Type: Bug
>          Components: SCR Tooling
>    Affects Versions: scr bnd plugin 1.4.0
>            Reporter: Konrad Windszus
>         Attachments: pom.xml
>
>
> If I have a POM with a plugin configuration like this
> {code}
> <plugin>
>   <groupId>org.apache.felix</groupId>
>   <artifactId>maven-bundle-plugin</artifactId>
>   <version>3.0.0</version>
>   <extensions>true</extensions>
>   <configuration>
>     <instructions>
>     <!-- support parsing of felix annotations through the felix.scr.bnd 
> plugin -->
>     
> <_plugin>org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin;destdir=target/classes</_plugin>
>     </instructions>
>   </configuration>
>   <dependencies>
>   <!-- 
> https://github.com/apache/felix/tree/trunk/tools/org.apache.felix.scr.bnd -->
>    <dependency>
>      <groupId>org.apache.felix</groupId>
>      <artifactId>org.apache.felix.scr.bnd</artifactId>
>      <version>1.4.0</version>
>    </dependency>
>  </dependencies>
>  </plugin>
> {code}
> Unfortunately {{org.apache.felix.scr.bnd}} depends on 
> {{biz.aQute.bnd:bndlib:jar:2.1.0}}. Therefore the classpath of 
> maven-bundle-plugin looks like this:
> {code}
> [DEBUG] Populating class realm 
> plugin>org.apache.felix:maven-bundle-plugin:3.0.0
> [DEBUG]   Included: org.apache.felix:maven-bundle-plugin:jar:3.0.0
> [DEBUG]   Included: org.apache.felix:org.apache.felix.scr.bnd:jar:1.4.0
> [DEBUG]   Included: biz.aQute.bnd:bndlib:jar:2.1.0
> [DEBUG]   Included: org.osgi:org.osgi.core:jar:4.3.1
> [DEBUG]   Included: biz.aQute.bnd:biz.aQute.bndlib:jar:3.0.0
> [DEBUG]   Included: 
> org.apache.felix:org.apache.felix.bundlerepository:jar:1.6.6
> [DEBUG]   Included: org.easymock:easymock:jar:2.5.2
> [DEBUG]   Included: org.apache.felix:org.apache.felix.utils:jar:1.6.0
> [DEBUG]   Included: org.osgi:org.osgi.compendium:jar:4.2.0
> [DEBUG]   Included: org.slf4j:slf4j-jdk14:jar:1.5.6
> [DEBUG]   Included: org.slf4j:slf4j-api:jar:1.5.6
> [DEBUG]   Included: org.slf4j:jcl-over-slf4j:jar:1.5.6
> [DEBUG]   Included: org.apache.maven.reporting:maven-reporting-api:jar:2.2.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-logging-api:jar:1.1
> [DEBUG]   Included: junit:junit:jar:4.11
> [DEBUG]   Included: org.hamcrest:hamcrest-core:jar:1.3
> [DEBUG]   Included: commons-cli:commons-cli:jar:1.2
> [DEBUG]   Included: 
> org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
> [DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
> [DEBUG]   Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
> [DEBUG]   Included: org.sonatype.plexus:plexus-cipher:jar:1.4
> [DEBUG]   Included: org.apache.maven:maven-archiver:jar:2.5
> [DEBUG]   Included: org.codehaus.plexus:plexus-archiver:jar:2.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-io:jar:2.0.2
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.15
> [DEBUG]   Included: org.apache.maven.shared:maven-dependency-tree:jar:2.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
> [DEBUG]   Included: org.eclipse.aether:aether-util:jar:0.9.0.M2
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.10
> [DEBUG]   Included: org.sonatype.plexus:plexus-build-api:jar:0.0.7
> [DEBUG]   Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-site-renderer:jar:1.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-core:jar:1.0
> [DEBUG]   Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7
> [DEBUG]   Included: org.codehaus.plexus:plexus-velocity:jar:1.1.7
> [DEBUG]   Included: org.apache.velocity:velocity:jar:1.5
> [DEBUG]   Included: commons-lang:commons-lang:jar:2.1
> [DEBUG]   Included: oro:oro:jar:2.0.8
> [DEBUG]   Included: org.apache.maven.doxia:doxia-decoration-model:jar:1.0
> [DEBUG]   Included: commons-collections:commons-collections:jar:3.2
> [DEBUG]   Included: org.apache.maven.doxia:doxia-module-apt:jar:1.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-module-fml:jar:1.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-module-xdoc:jar:1.0
> [DEBUG]   Included: org.apache.maven.doxia:doxia-module-xhtml:jar:1.0
> [DEBUG]   Excluded: org.apache.maven:maven-core:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.2.0
> [DEBUG]   Excluded: 
> org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.2.0
> [DEBUG]   Excluded: 
> org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
> [DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-error-diagnostics:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.2.0
> [DEBUG]   Excluded: org.apache.maven:maven-monitor:jar:2.2.0
> [DEBUG]   Excluded: classworlds:classworlds:jar:1.1
> {code}
> So the classpath contains both bnd 2.1 and bnd 3.0.
> IMHO the {{felix.scr.bnd}} should not transitively influence the classpath. I 
> guess marking the dependency to bnd as provided in its pom.xml should do the 
> trick here!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to