Maven Build in Rational - NoClassDefFoundError: org.codehaus.classworlds.Launcher
5 answers
OK. I succeeded in the build. The key was to remove the \bin from the end of the Maven home: variable in the build definition settings.
"C:\Program Files\Apache Software Foundation\apache-maven-3.0.4".
I also changed my Project location: to include \my-app a the end.. which makes
"C:\Users\ibmrat\workspace\my-app"
I am using the amy-app pplication generated from http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html which is a good sample application. I advise to use this application to test.
Hi Tommy,
I also get the same error. Here is what I get:
2013-02-19 14:58:14 [Jazz build engine] running on host: XXXXXXX
2013-02-19 14:58:14 [Jazz build engine] Should build occur?
2013-02-19 14:58:14 [Jazz build engine] Yes: Always build a user initiated request.
2013-02-19 14:58:14 [Jazz build engine] Invoking build participant "com.ibm.team.build.maven"
Exception in thread "main" java.lang.NoClassDefFoundError
: org.codehaus.classworlds.Launc
her
Caused by: java.lang.ClassNotFoundExcepti
on: org.codehaus.classworlds.Launc
her
at java.net.URLClassLoader.findCl
ass(URLClassLoader.java:434)
at java.lang.ClassLoader.loadClas
s(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoad
er.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClas
s(ClassLoader.java:626)
Could not find the main class: org.codehaus.classworlds.Launc
her. Program will exit.
Build failed. Exit value was 1.
It seems that the C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\
boot\plexus-classworlds-2.4.ja
r is not in classpath, but building from Maven and not Eclipse client works fine. We tried adding -cp "C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\
boot\plexus-classworlds-2.4.ja
r" to the Java VM arguments section in build definition, but this did not seem to resolve issue.
<Reproduce steps>
1. Download Windows Maven v3.0.4 from http://maven.apache.org and add environment variables carefully as per instructions.
2. Create the sample using steps under http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
3. Unzip the build feature RTC-BuildSystem-Toolkit-Win-4.
0.1.zip and copy jdk from RTC 4.0.1 Eclipse client as per instructions
4. Create a build definition for Maven in RTC project area and configure as per screen captures.
5. Click "Create" button in Overview section to create a build engine.
6. Run jbe -vm {path_to_jdk}/bin/java -repository {repositoryURL} -userId {user} -pass {password} -engineId {engine}
7. Copy the sample maven project to your configured build workspace.
8. Invoke a build from the Builds view.
Can someone help?
I also get the same error. Here is what I get:
2013-02-19 14:58:14 [Jazz build engine] running on host: XXXXXXX
2013-02-19 14:58:14 [Jazz build engine] Should build occur?
2013-02-19 14:58:14 [Jazz build engine] Yes: Always build a user initiated request.
2013-02-19 14:58:14 [Jazz build engine] Invoking build participant "com.ibm.team.build.maven"
Exception in thread "main" java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundExcepti
at java.net.URLClassLoader.findCl
at java.lang.ClassLoader.loadClas
at sun.misc.Launcher$AppClassLoad
at java.lang.ClassLoader.loadClas
Could not find the main class: org.codehaus.classworlds.Launc
Build failed. Exit value was 1.
It seems that the C:\Program Files\Apache Software Foundation\apache-maven-3.0.4\
<Reproduce steps>
1. Download Windows Maven v3.0.4 from http://maven.apache.org and add environment variables carefully as per instructions.
2. Create the sample using steps under http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
3. Unzip the build feature RTC-BuildSystem-Toolkit-Win-4.
4. Create a build definition for Maven in RTC project area and configure as per screen captures.
5. Click "Create" button in Overview section to create a build engine.
6. Run jbe -vm {path_to_jdk}/bin/java -repository {repositoryURL} -userId {user} -pass {password} -engineId {engine}
7. Copy the sample maven project to your configured build workspace.
8. Invoke a build from the Builds view.
Can someone help?
It appears that this is a problem with mixing Maven 2 scripts with a Maven 3 engine.
http://cyntech.wordpress.com/2011/03/09/maven-2-error/
or a missing classworlds jar from the path:
http://www.permeance.com.au/web/terry.mueller/home/-/blogs/maven2-reports-java-lang-noclassdeffounderror:-org-codehaus-classworlds-launcher
Does the same Maven script run from the command line without problems?
~Spencer