Red Hat Bugzilla – Bug 1285062
maven30: Please upgrade to use objectweb-asm v5 for maven at runtime
Last modified: 2016-04-12 08:43:17 EDT
Description of problem:
We have a use case where we build with the maven30 collection enabled. That collections' maven uses objectweb-asm v3 for runtime. In that dependent collection we've built felix-scr-maven-plugin. What's more, the project we are building also requires objectweb-asm v5 (for JDK 8 class file support). That combination of maven30-maven + rh-java-common-objectweb-asm + rh-java-common-objectweb-asm5 + thermostat1-felix-scr-maven-plugin seems to trigger a bug resulting in this:
[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.21.0:scr (generate-scr-scrdescriptor) on project thermostat-vm-heap-analysis-common: Execution generate-scr-scrdescriptor of goal org.apache.felix:maven-scr-plugin:1.21.0:scr failed: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.21.0:scr: java.lang.IncompatibleClassChangeError: class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
[ERROR] realm = plugin>org.apache.felix:maven-scr-plugin:1.20.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls = file:/opt/rh/thermostat1/root/usr/share/java/felix-scr-maven-plugin/maven-scr-plugin.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus-containers/plexus-component-annotations.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/sisu/sisu-inject-bean.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/atinject.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/objectweb-asm/asm.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/guice/google-guice-no_aop.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/slf4j/slf4j-api.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/guava.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/cglib.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/maven-archiver/maven-archiver.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/aether/aether-util.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/plexus-sec-dispatcher.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/plexus-cipher.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/archiver.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/xbean/xbean-reflect.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/lib/java/log4j.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/apache-commons-logging-api.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/junit.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/hamcrest/core.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/io.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/commons-compress.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/xz-java.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/utils.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/interpolation.jar
[ERROR] urls = file:/opt/rh/thermostat1/root/usr/share/java/felix/org.apache.felix.scr.generator.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/objectweb-asm5/asm-all-5.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.core.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.compendium.jar
[ERROR] urls = file:/opt/rh/rh-java-common/root/usr/share/java/tomcat-servlet-3.0-api.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.foundation.jar
[ERROR] urls = file:/opt/rh/maven30/root/usr/share/java/plexus/plexus-build-api.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>com.redhat.thermostat:thermostat-annotations:1.99.7, parent: ClassRealm[maven.api, parent: null]]]
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. copr build jerboaa/thermostat-latest https://jerboaa.fedorapeople.org/scratch/thermostat-1.99.7-89.fedora.src.rpm
build success, just as the one that succeeds for Fedora rawhide.
This might not be possible for maven30, but perhaps for a later updated maven collection.
Example failed build:
AFAIK, objectweb-asm is only used by sisu.
This is not a problem for upstream because they are using bundled and shaded ASM, while we are unbundling it. Using shaded ASM should solve this.
Is there any progress on that? We depend on the resolution of this bug to merge into Thermostat some important changes that are currently on hold.
We'll definitely fix this issue in next RHSCL release, but unfortunately I can't give you an ETA at the moment.
For now, I could try to prepare a copr repository with fixed maven30 maven+sisu. Would that help?
(In reply to Michal Srb from comment #4)
> We'll definitely fix this issue in next RHSCL release, but unfortunately I
> can't give you an ETA at the moment.
That's good to know.
> For now, I could try to prepare a copr repository with fixed maven30
> maven+sisu. Would that help?
That would help a great deal, thanks!
It was a bit trickier than I thought. Not only sisu, but also google-guice package needed to be fixed. google-guice has optional dependency on cglib (which pulls in asm3), but the optional flag is ignored by XMvn and javapackages-tools in RHSCL 2.1.
Anyway, this copr repository should, hopefully, do the trick:
(In reply to Michal Srb from comment #6)
> Anyway, this copr repository should, hopefully, do the trick:
Thanks a lot. I'm going to test this in the next couple of days.
(In reply to Severin Gehwolf from comment #7)
> (In reply to Michal Srb from comment #6)
> > Anyway, this copr repository should, hopefully, do the trick:
> > https://copr.fedoraproject.org/coprs/msrb/maven30-bundled-asm/
> Thanks a lot. I'm going to test this in the next couple of days.
The copr repo works for us. Thanks again! We are now unblocked.