Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5074

Using org.apache.felix.scr.bnd together with maven-bundle-plugin leads to using the wrong bnd version

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: scr bnd plugin 1.4.0
    • Fix Version/s: scr bnd plugin 1.5.0
    • Component/s: SCR Tooling
    • Labels:
      None

      Description

      If I have a POM with a plugin configuration like this

      <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>
      

      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:

      [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
      

      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!

        Attachments

        1. pom.xml
          1 kB
          Konrad Windszus

          Issue Links

            Activity

              People

              • Assignee:
                pderop Pierre De Rop
                Reporter:
                kwin Konrad Windszus
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: