How can I resolve Maven plugin build error?

Viewed 91

I am facing the below error while I am importing a plugin to the eclipse, using the existing Maven Project option.

ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.7:assembly (install-kar) on project eric-gui-aggregator: Unable to build assembly: Uses constraint violation. Unable to resolve resource org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1] because it is exposed to package 'javax.annotation' from resources system.bundle [system.bundle/0.0.0] and org.jsr-305 [org.jsr-305/3.0.2] via two dependency chains.
[ERROR] 
[ERROR] Chain 1:
[ERROR]   org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1]
[ERROR]     import: (osgi.wiring.package=javax.annotation)
[ERROR]      |
[ERROR]     export: osgi.wiring.package: javax.annotation
[ERROR]   system.bundle [system.bundle/0.0.0]
[ERROR] 
[ERROR] Chain 2:
[ERROR]   org.apache.servicemix.bundles.okhttp [org.apache.servicemix.bundles.okhttp/3.12.1.1]
[ERROR]     import: (osgi.wiring.package=javax.annotation.meta)
[ERROR]      |
[ERROR]     export: osgi.wiring.package: javax.annotation.meta; uses:=javax.annotation
[ERROR]     export: osgi.wiring.package=javax.annotation
[ERROR]   org.jsr-305 [org.jsr-305/3.0.2]

I tried to exclude com.google.code.findbugs:jsr305 using the below tag but still I am getting the same build error.

<artifactSet>
    <excludes>
          <exclude>com.google.code.findbugs:jsr305</exclude>
    </excludes>
</artifactSet>

We are using Java 11 in our project.

0 Answers
Related