Maven: A required class is missing: hidden/org/codehaus/plexus/interpolation/ValueSource

I had the following issue when building one of our projects on a freshly installed Linux Mint:

-----------------------------------------------------
this realm = app0.child-container[org.zeroturnaround:javarebel-maven-plugin:1.0.5]
urls[0] = file:/home/phillip/.m2/repository/org/zeroturnaround/javarebel-maven-plugin/1.0.5/javarebel-maven-plugin-1.0.5.jar
urls[1] = file:/home/phillip/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
urls[2] = file:/home/phillip/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
urls[3] = file:/home/phillip/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8


this realm = plexus.core
urls[0] = file:/usr/share/maven2/lib/maven-debian-uber.jar
Number of imports: 10
import: org.codehaus.classworlds.Entry@a6c57a42
import: org.codehaus.classworlds.Entry@12f43f3b
import: org.codehaus.classworlds.Entry@20025374
import: org.codehaus.classworlds.Entry@f8e44ca4
import: org.codehaus.classworlds.Entry@92758522
import: org.codehaus.classworlds.Entry@ebf2705b
import: org.codehaus.classworlds.Entry@bb25e54
import: org.codehaus.classworlds.Entry@bece5185
import: org.codehaus.classworlds.Entry@3fee8e37
import: org.codehaus.classworlds.Entry@3fee19d8
-----------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 'org.zeroturnaround:javarebel-maven-plugin:1.0.5:generate': 
Unable to load the mojo 'org.zeroturnaround:javarebel-maven-plugin:1.0.5:generate' in the plugin 'org.zeroturnaround:javarebel-maven-plugin'. 
A required class is missing: hidden/org/codehaus/plexus/interpolation/ValueSource
hidden.org.codehaus.plexus.interpolation.ValueSource
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47 seconds
[INFO] Finished at: Thu Jan 09 19:08:02 CET 2014
[INFO] Final Memory: 52M/124M
[INFO] ------------------------------------------------------------------------

Turns out that the maven 2 version that comes from the Ubuntu repository is a bit fubar.
Download the latest maven 2 release from maven.apache.org and replace the /usr/share/maven2/lib/maven-debian-uber.jar library with the on from the downloaded archive. Now your build won’t fail (at least on this issue).

Or fix it in shell style:

if [[ -d /usr/share/maven2/lib/ ]]; then echo Good; else echo Maven not installed ?; exit 1; fi
wget http://apache.belnet.be/maven/maven-2/2.2.1/binaries/apache-maven-2.2.1-bin.tar.gz
tar --wildcards --strip-components 2 -xvf apache-maven-2.2.1-bin.tar.gz apache-maven-2.2.1/lib/*
rm apache-maven-2.*-bin.tar.gz
echo Needs root access to change files in /usr/share/maven2/lib/
sudo rm /usr/share/maven2/lib/maven-debian-*.jar
sudo mv maven-2*-uber.jar /usr/share/maven2/lib/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s