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

scr bnd plugin incompatible with maven-bundle-plugin 2.5.0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: scr bnd plugin 1.0.0, scr bnd plugin 1.1.0
    • Fix Version/s: scr bnd plugin 1.3.0
    • Component/s: SCR Tooling
    • Labels:
      None
    • Environment:

      Description

      Using the scr bnd plugin inside maven-bundle-plugin fails with java.lang.NoSuchMethodError: aQute.bnd.osgi.Verifier.isStrict()Z
      (full pom.xml attached)

            <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-bundle-plugin</artifactId>
              <version>2.5.0</version>
              <extensions>true</extensions>
              <configuration>
                <instructions>
                  <_plugin>org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin</_plugin>
                </instructions>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>org.apache.felix</groupId>
                  <artifactId>org.apache.felix.scr.bnd</artifactId>
                  <version>1.1.0</version>
                </dependency>
              </dependencies>
            </plugin>
      

      Root cause is that scr-bnd plugin includes an incompatible version of bndlib (2.1.0) while maven-bundle-plugin 2.5.0 is using bndlib 2.3.0. In the maven context, scr-bnd plugin is first in the class path and so, its embedded version of bndlib wins.

      Probably scr-bnd plugin should not include a version of bndlib at all, but expect it to be provided by the caller of the plugin.

      workaround
      add a dependency on bndlib before scr-bnd plugin:

            <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-bundle-plugin</artifactId>
              <version>2.5.0</version>
              <dependencies>
                <dependency>
                  <groupId>biz.aQute.bnd</groupId>
                  <artifactId>bndlib</artifactId>
                  <version>2.3.0</version>
                </dependency>
                <dependency>
                  <groupId>org.apache.felix</groupId>
                  <artifactId>org.apache.felix.scr.bnd</artifactId>
                  <version>1.1.0</version>
                </dependency>
              </dependencies>
            </plugin>
      

        Attachments

        1. pom.xml
          1 kB
          Timo Naroska

          Issue Links

            Activity

              People

              • Assignee:
                pderop Pierre De Rop
                Reporter:
                tnarake Timo Naroska
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: