Just as a follow-up, it turns out I do have a maven home, /usr/share/maven2, but setting my M2_HOME env variable didn't help. A colleague suggested that this might be an issue with plugin dependency.
Also, I failed to mention in my original post that maven works in all the build steps except the post step which is a top level maven target. Thanks for your attention, -ramin On Tue, Oct 22, 2013 at 10:41 AM, Ramin Rad <ramins...@gmail.com> wrote: > I am having a class not found exception in Jenkins when I run a “Post > Step” top-level maven target. A google search leads me to not having set > M2_HOME or M3_HOME env variable. But on my Ubuntu, I don’t have a maven > home because I used apt-get to install maven and didn’t build it from > scratch! > > > > Do you know where maven stores the jar files it needs? > > > Snippet of the build logs are below. > > > Thanks, > > -ramin > > > > > [workspace] $ mvn -f pom.xml mytarget > > Exception in thread "main" java.lang.NoClassDefFoundError: > org/codehaus/classworlds/Launcher > > Caused by: java.lang.ClassNotFoundException: > org.codehaus.classworlds.Launcher > > at java.net.URLClassLoader$1.run(URLClassLoader.java:202) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:190) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:247) > > Could not find the main class: org.codehaus.classworlds.Launcher. Program > will exit. > > Build step 'Invoke top-level Maven targets' marked build as failure > > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.