How to add third-party extension to maven-plugin

201 views
Skip to first unread message

Aurélien Bourdon

unread,
May 13, 2013, 8:36:12 AM5/13/13
to jenkins...@googlegroups.com
Hi all,

I would like to add a third-party extension (e.g https://github.com/johnjcool/and-activation-profile-selector) to my Maven builds. However, any of my following actions were doomed to failure...

1. Add the extension .jar to my $MAVEN_HOME/lib/ext directory
2. Add the extension .jar to my $MAVEN_HOME/lib directory
3. Add the extension .jar to my .jenkins/plugins/maven-plugin/WEB-INF/lib directory
4. Create the .jenkins/plugins/maven-plugin/WEB-INF/lib/ext directory and add the extension .jar to it

Is anyone has a clue?

Note that when I directly use my Maven installation it just fine. It seems to be related to the Jenkins maven-plugin and the way to add a third-party extension to it.

Regards,
Aurelien

Aurélien Bourdon

unread,
May 14, 2013, 5:42:25 AM5/14/13
to jenkins...@googlegroups.com
Solved in adding the ${MAVEN_HOME}/lib/ext directory to the original maven3-agent's classworlds.conf file and in adding -Dclassworlds.conf=<path to the specific classworlds.conf file> to the MAVEN_OPTS variable.

My classworlds.conf file looks like (note the optionally add of ${maven.home}/lib/ext/*.jar):

#
# mostly copied as-is from $MAVEN_HOME/bin/m2.conf
#
main is org.jvnet.hudson.maven3.launcher.Maven3Launcher from plexus.core

set maven.home default ${user.home}/m2

[plexus.core]
load            ${maven3.interceptor}
optionally      ${maven.home}/lib/ext/*.jar
load            ${maven.home}/lib/*.jar
Reply all
Reply to author
Forward
0 new messages