Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,070
Community Members
 
Community Events
168
Community Groups

classdefnotfoundexception during bitbucket plugin execution

I try to develop a bitbucket plugin. This plugin need to consume a dependency call com.soprahr.factory.api.devops.

<dependency>
<groupId>com.soprahr.factory.api.devops</groupId>
<artifactId>domain</artifactId>
<version>${com.soprahr.factory.api.devops.domain.version}</version>
<scope>compile</scope>
</dependency>

When I builded the plugin, maven returned the log bellow.

NFO] --- bitbucket-maven-plugin:8.2.0:validate-banned-dependencies (default-validate-banned-dependencies) @ com.soprahr.paas.scm.fork ---
[INFO] validate banned dependencies
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
make sure platform artifacts are not bundled into plugin
Found Banned Dependency: org.slf4j:jcl-over-slf4j:jar:1.7.25
Found Banned Dependency: org.springframework:spring-beans:jar:5.2.6.RELEASE
Found Banned Dependency: com.google.guava:guava:jar:26.0-jre
Found Banned Dependency: javax.annotation:javax.annotation-api:jar:1.3.2
Found Banned Dependency: org.apache.commons:commons-lang3:jar:3.8.1
Found Banned Dependency: javax.ws.rs:javax.ws.rs-api:jar:2.0.1
Found Banned Dependency: org.apache.httpcomponents:httpmime:jar:4.5.10
Found Banned Dependency: dom4j:dom4j:jar:1.6.1-atlassian-2
Found Banned Dependency: org.slf4j:slf4j-api:jar:1.7.25
Found Banned Dependency: javax.validation:validation-api:jar:2.0.1.Final
Found Banned Dependency: com.google.code.findbugs:jsr305:jar:3.0.0
Found Banned Dependency: org.apache.httpcomponents:httpclient:jar:4.5.10
Found Banned Dependency: org.apache.httpcomponents:httpcore:jar:4.4.12
Found Banned Dependency: org.springframework:spring-core:jar:5.2.6.RELEASE

I excluded all banned dependencies and my plugin correctly builded.

<dependency>
<groupId>com.soprahr.factory.api.devops</groupId>
<artifactId>domain</artifactId>
<version>${com.soprahr.factory.api.devops.domain.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</exclusion>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>


During the runtime exececution, classdefnotfoundexception was throwed by the plugin as soon as I use one of this ban dependency

I try to add ban dependencies in my pom.xml as provided dependency. The result was the same.

Should I add something in the Import package ? As of now, my import package is the following.

<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
*
javax.servlet*;version="2.5",
*;version="0";resolution:=optional,
</Import-Package>

My experiences with OSGI is limited. I suppose I don't understand several concepts.

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.6.3
TAGS

Atlassian Community Events