Details
-
Bug
-
Resolution: Answered
-
Low
-
None
-
5.6.3
-
Mac OS X 10.11.1, Atlassian Plugin SDK 6.1.0
-
Severity 3 - Minor
-
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.