How to tell Jenkins to use a different ASM version when comes to a specific plugin?

187 views
Skip to first unread message

Ognjen Bubalo

unread,
Jul 8, 2012, 4:48:15 PM7/8/12
to jenkin...@googlegroups.com
Hello,

In the JaCoCo plugin I would like to use ASM 3.3.1 but the ASM 2.2.3 is loaded for some reason (maybe Jenkins uses it?). How could I tell Jenkins to use a newer ASM when the plugin's classes are loaded?

Thank you!

Br, Ogi

Stephen Connolly

unread,
Jul 9, 2012, 4:41:51 AM7/9/12
to jenkin...@googlegroups.com
You can switch the classloader delegation mode (it is a config parameter of the maven plugin)

Sandell, Robert

unread,
Jul 9, 2012, 4:48:00 AM7/9/12
to jenkin...@googlegroups.com

Kohsuke write something around this a while back http://kohsuke.org/2012/03/03/potd-package-renamed-asm/

But using those packages might interfere with JaCoCo too much.

 

 

Robert Sandell

Software Tools Engineer - Tools and Integration

Sony Mobile Communications

Ognjen Bubalo

unread,
Jul 9, 2012, 10:42:18 AM7/9/12
to jenkin...@googlegroups.com
Can you help me how to do the switch? Is there any wiki our mailing list thread about it?

Thank you,
Ogi

Jesse Glick

unread,
Jul 10, 2012, 10:09:45 AM7/10/12
to jenkin...@googlegroups.com
On 07/09/2012 10:42 AM, Ognjen Bubalo wrote:
> Can you help me how to do the switch?

I guess you just want: <pluginFirstClassLoader>true</pluginFirstClassLoader>

Kohsuke Kawaguchi

unread,
Jul 10, 2012, 12:15:50 PM7/10/12
to jenkin...@googlegroups.com
Yes, this is what I recommend --- use the package renamed version tied
to the major ASM version.

But this only works if you are the user of ASM, and not if you need to
bundle a library that uses ASM. For this situation, I think Jenkins
supports class masking that lets you ignore specific packages from the
dependencies and from the core.

2012/7/9 Sandell, Robert <Robert....@sonymobile.com>:
--
Kohsuke Kawaguchi

Ognjen Bubalo

unread,
Jul 10, 2012, 12:21:13 PM7/10/12
to jenkin...@googlegroups.com
Hmm. Yes, looks like the plugin loads the ASM 3.3.1, but still I have the same problem. This is about JaCoCo plugin.

...
[Loaded org.objectweb.asm.ClassVisitor from file:/C:/Users/Ognjen%20Bubalo/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar]
...
FATAL: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V

Br, Ogi

Ognjen Bubalo

unread,
Jul 12, 2012, 9:24:53 PM7/12/12
to jenkin...@googlegroups.com
The shade plugin helped me in this:

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
   
Thanks to everyone for the ideas,
ogi
Reply all
Reply to author
Forward
0 new messages