Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17002

Bamboo Plugin SDK does not embed properly 3rd party library dependency after dependency is updated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Answered
    • Low
    • None
    • 5.6.3
    • Dependencies, Maven, Plugins
    • Mac OS X 10.11.1, Atlassian Plugin SDK 6.1.0

    Description

      In my pom.xml I had following dependency:

      		<dependency>
      			<groupId>org.apache.jackrabbit</groupId>
      			<artifactId>jackrabbit-webdav</artifactId>
      			<version>2.10.1</version>
      			<scope>provided</scope>
      		</dependency>
      

      When classes from this library are used by my plugin, I getting java.lang.NoClassDefFoundError exception:

      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
      [INFO] [talledLocalContainer] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      

      because bamboo system bundle does not contain jackrabbit library.

      Then I updated my pom.xml dependency like this:

      		<dependency>
      			<groupId>org.apache.jackrabbit</groupId>
      			<artifactId>jackrabbit-webdav</artifactId>
      			<version>2.10.1</version>
      			<scope>compile</scope>
      			<exclusions>
      				<exclusion>
      					<groupId>org.slf4j</groupId>
      					<artifactId>jcl-over-slf4j</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.slf4j</groupId>
      					<artifactId>slf4j-api</artifactId>
      				</exclusion>
      			</exclusions>
      		</dependency>
      

      But unfortunately it did not made any effect, still the same exception:

      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)
      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
      [INFO] [talledLocalContainer] 	at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
      [INFO] [talledLocalContainer] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      

      In documentation it is explicitly specified that if my dependency has

      <scope>compile</scope>

      scope set, it will be available in Runtime.

      To fix the problem I had to run

      apache-mvn clean which removed completely my debug bamboo "target" root directory and all configurations made for debugging were lost. I had to re-configure my debugging plan presets and other stuff again.

      Maven should properly embed changes on dependencies to already existing bamboo environment without requiring to recreate it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            7997cf464106 Eugene Dudnyk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: