Bug 1285062 - maven30: Please upgrade to use objectweb-asm v5 for maven at runtime
Summary: maven30: Please upgrade to use objectweb-asm v5 for maven at runtime
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: sisu
Version: rh-maven33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 2.2
Assignee: Mikolaj Izdebski
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-24 19:11 UTC by Severin Gehwolf
Modified: 2016-04-12 12:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-12 12:43:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Severin Gehwolf 2015-11-24 19:11:17 UTC
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] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.felix:maven-scr-plugin:1.20.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/opt/rh/thermostat1/root/usr/share/java/felix-scr-maven-plugin/maven-scr-plugin.jar
[ERROR] urls[1] = file:/opt/rh/maven30/root/usr/share/java/plexus-containers/plexus-component-annotations.jar
[ERROR] urls[2] = file:/opt/rh/maven30/root/usr/share/java/sisu/sisu-inject-bean.jar
[ERROR] urls[3] = file:/opt/rh/rh-java-common/root/usr/share/java/atinject.jar
[ERROR] urls[4] = file:/opt/rh/rh-java-common/root/usr/share/java/objectweb-asm/asm.jar
[ERROR] urls[5] = file:/opt/rh/maven30/root/usr/share/java/guice/google-guice-no_aop.jar
[ERROR] urls[6] = file:/opt/rh/rh-java-common/root/usr/share/java/slf4j/slf4j-api.jar
[ERROR] urls[7] = file:/opt/rh/rh-java-common/root/usr/share/java/guava.jar
[ERROR] urls[8] = file:/opt/rh/maven30/root/usr/share/java/cglib.jar
[ERROR] urls[9] = file:/opt/rh/maven30/root/usr/share/java/maven-archiver/maven-archiver.jar
[ERROR] urls[10] = file:/opt/rh/maven30/root/usr/share/java/aether/aether-util.jar
[ERROR] urls[11] = file:/opt/rh/maven30/root/usr/share/java/plexus/plexus-sec-dispatcher.jar
[ERROR] urls[12] = file:/opt/rh/maven30/root/usr/share/java/plexus/plexus-cipher.jar
[ERROR] urls[13] = file:/opt/rh/maven30/root/usr/share/java/plexus/archiver.jar
[ERROR] urls[14] = file:/opt/rh/rh-java-common/root/usr/share/java/xbean/xbean-reflect.jar
[ERROR] urls[15] = file:/opt/rh/rh-java-common/root/usr/lib/java/log4j.jar
[ERROR] urls[16] = file:/opt/rh/rh-java-common/root/usr/share/java/apache-commons-logging-api.jar
[ERROR] urls[17] = file:/opt/rh/rh-java-common/root/usr/share/java/junit.jar
[ERROR] urls[18] = file:/opt/rh/rh-java-common/root/usr/share/java/hamcrest/core.jar
[ERROR] urls[19] = file:/opt/rh/maven30/root/usr/share/java/plexus/io.jar
[ERROR] urls[20] = file:/opt/rh/rh-java-common/root/usr/share/java/commons-compress.jar
[ERROR] urls[21] = file:/opt/rh/rh-java-common/root/usr/share/java/xz-java.jar
[ERROR] urls[22] = file:/opt/rh/maven30/root/usr/share/java/plexus/utils.jar
[ERROR] urls[23] = file:/opt/rh/maven30/root/usr/share/java/plexus/interpolation.jar
[ERROR] urls[24] = file:/opt/rh/thermostat1/root/usr/share/java/felix/org.apache.felix.scr.generator.jar
[ERROR] urls[25] = file:/opt/rh/rh-java-common/root/usr/share/java/objectweb-asm5/asm-all-5.jar
[ERROR] urls[26] = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.core.jar
[ERROR] urls[27] = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.compendium.jar
[ERROR] urls[28] = file:/opt/rh/rh-java-common/root/usr/share/java/tomcat-servlet-3.0-api.jar
[ERROR] urls[29] = file:/opt/rh/maven30/root/usr/share/java/felix/org.osgi.foundation.jar
[ERROR] urls[30] = 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):
maven30

How reproducible:
100%

Steps to Reproduce:
1. copr build jerboaa/thermostat-latest https://jerboaa.fedorapeople.org/scratch/thermostat-1.99.7-89.fedora.src.rpm

Actual results:
IncompatibleClassChangeError

Expected results:
build success, just as the one that succeeds for Fedora rawhide.

Additional info:
This might not be possible for maven30, but perhaps for a later updated maven collection.

Comment 1 Severin Gehwolf 2015-11-24 19:12:14 UTC
Example failed build:
https://copr.fedoraproject.org/coprs/jerboaa/thermostat-latest/build/142180/

Comment 2 Mikolaj Izdebski 2015-11-25 10:26:09 UTC
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.

Comment 3 Mario Torre 2015-12-08 15:29:21 UTC
Hi Mokolaj,

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.

Thanks,
Mario

Comment 4 Michal Srb 2015-12-09 13:45:10 UTC
Hi Mario,

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?

Comment 5 Severin Gehwolf 2015-12-09 13:49:43 UTC
(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!

Comment 6 Michal Srb 2015-12-09 21:24:56 UTC
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:
https://copr.fedoraproject.org/coprs/msrb/maven30-bundled-asm/

Comment 7 Severin Gehwolf 2015-12-10 10:09:46 UTC
(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.

Comment 8 Severin Gehwolf 2015-12-10 12:46:14 UTC
(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[1]. Thanks again! We are now unblocked.

[1] https://copr.fedoraproject.org/coprs/jerboaa/thermostat-latest/build/146799/


Note You need to log in before you can comment on or make changes to this bug.