Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to find executable at /usr/bin/mvn/bin/mvn. Will try to run it anyway.

paulwade May 12, 2015

I have added an executable for maven 3 with the path of /usr/bin/mvn whenever I create a build task to use maven I get the error 

Unable to find executable at /usr/bin/mvn/bin/mvn. Will try to run it anyway.

 

Why is bamboo adding /bin/mvn to /user/bin?

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2015

Paul, when you add the Maven executable in Bamboo you don't provide the full path:

/usr/local/apache-maven/apache-maven-3.2.1/bin/mvn

but path to the maven home:

/usr/local/apache-maven/apache-maven-3.2.1

Please reconfigure the capability and it all should just work.

1 vote
Deleted user May 12, 2015

Bamboo expects the MAVEN_HOME path for a maven executable entry, rather than the exact path to "mvn", hence why it adds /bin/mvn.

For example, on our build servers, we use "c:\buildtools\maven-2.0.4" for Windows or "/opt/maven" on linux.

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2015

Hello Paul,

Thank you for your update.

It might be the case where "/usr/bin/mvn" is a symbolic link to somewhere else. Could you please run the following command from Terminal:

# command
ls -l /usr/bin/mvn
 
# response if symbolic link
lrwxr-xr-x  1 root  wheel  74 Nov  3  2014 /usr/bin/mvn -> /usr/share/maven/bin/mvn

If you have a symbolic link as the example above suggests, then you should be adding "/usr/share/maven" as Maven capability in Bamboo. So when the Maven task gets run, Bamboo will automatically add "/bin/mvn" and execute Maven.

If you have done the export from previous comment, the same will not be available to Bamboo until you stop and start the application. Please, notice you should be running Bamboo from the same Terminal (session) where you have run the export command, otherwise, "M2_HOME" will not be available. In order to make them available globally, please refer to How to install Maven on Mac OSX that covers installation and environment variables.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2015

Hello Paul,

Thank you for your question.

Bamboo uses the M2_HOME variable as base to set up Maven as a capability, even though you do not have this variable set up, Bamboo will use the same principle to run Maven by appending "/bin/mvn" to the capability path.

(Windows) Set the environment variables using system properties. 
M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-3.2.1
M2=%M2_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m
(Linux/MacOS) Open command terminal and set environment variables.
export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=$M2_HOME/bin
export MAVEN_OPTS=-Xms256m -Xmx512m

As you can notice, the M2_HOME variable does not provide "/bin/mvn" to its path, neither Bamboo.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

paulwade May 13, 2015

So I added these exports. Now I have to add a maven executable what is the path? Ive tried many variation but bamboo always adds to the path with some unexpected values. I still get the errors "can't find..." usr/bin/bin/mvn /usr/bin/mvn/bin/mvn etc

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events