Bamboo claims it cannot find '/usr/bin/mvn'

Barry Kaplan April 17, 2012

I cannot the agent to recognize that /usr/bin/mvn exists. Hence my matrix says not jobs can be run. I even installed maven from a tar.gz and still bamboo gives the little red x for 'mvn exists'. What can I do to figure out what is going on?

3 answers

1 accepted

1 vote
Answer accepted
Barry Kaplan April 18, 2012

Sorry Piotr, I misunderstood. I added _only_ /home/pstefaniak/apache-maven-2.2.1 as the path and now it seems to be running. Of course this means that maven needs an non-standard install on linux, which, I would think, should be considered a bug. Buy hey, at least I'm past this. Thanks!

1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2012

Did you add maven as a capability? For the agent?

0 votes
Barry Kaplan April 18, 2012

Yes. I've added /usr/bin/mvn as an executable and it shows in the agent. But when I run the build or view the matrix I get error saying 'mvn exists' (not exits is what it means).

I really wish bamboo would verify an executable when its created not sometime later.

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

Can you paste the screenshot of your agent capabilities relevant configuration page(s)? I do wonder if you added /usr/bin/mvn as a Maven capability (good) or as an custom executable capability (not good)...

Barry Kaplan April 18, 2012

I added it as an executable. But also (somewhere else) I added it by selecting from a list that showed Maven 1.x, Maven 2.x, Maven 3.x. That seemed to make no difference. I have shutdown bamboo for a bit and restarted teamcity becuase we have some builds that need building. I'll get back to bamboo it a bit. Thanks!

Barry Kaplan April 18, 2012

Ok I deleted the maven executable and the maven job step and re-added both. Don't see what I did different but the agent can now run the job. However when it does I get various errors:

1) If I give a path to mvn as /usr/bin/mvn it tries to execute /usr/bin/mvn/bin/mvn

2) If I give a path of mvn it tries to execute mvn/bin/mvn

3) If I give a path of /usr I get

xception 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.

Barry Kaplan April 18, 2012

I see what happened with the agent not supporting maven. You have to create (or at least update) the job task AFTER the maven capability/executable is defined.

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

Hm... seems you need to specify the maven home directory (/home/pstefaniak/apache-maven-2.2.1) instead of the mvn itself.

Barry Kaplan April 18, 2012

As I mentioned in original post, I already tried that. Bamboo simply added /bin/mvn to the full path of /home/pstefaniak/apache-maven-2.2.1.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events