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?
Community moderators have prevented the ability to post new answers.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.