Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Configuring JAZZ command line Build definition to recognize Maven

I'm running a command line build definition which calls a shell script which in turn uses maven to execute some tasks. However my build fails because the build engine can't find Maven on the Path. Is it possible to configure my build definition to recognize Maven ? I tried to do this by setting maven as one of the definitions properties however i had no success. 

Error
mvn: command not found

0 votes


Accepted answer

Permanent link
 Colin, the command line build in newer versions provides an option to export the properties as environment variables. You can also use the properties in the build definition e.g. ${my property}\mvn.exe.

I would set the location property for maven ("MyMavenHome") in the build engine, to make it machine specific and then publish it as environment variable using the check box on the command line build. I can't remember when this capability was introduced.
Colin Duggan selected this answer as the correct answer

1 vote

Comments

yes Maven Home is set on the build engine and i just refer to this via a property in the properties section of my build definition. The in the "command line" tab in the Environment variables section i check the "Add build properties to native environment" however this raises issues with MVN and sometimes JAVA_HOME although both are set on the build engine. (I don't refer to JAVA_HOME in my properties in the Build definition) 

You can dump the properties of your build into a text file to make sure that all values are expanded, for example the external Maven_Home. External environment variables are not available to me in the build definition for expansion using ${env_var_name};

You can, on the build machine, add your folder with the Maven binaries to the path also, which would remove the issue with not finding it.

Other than that, I am not sure I can help further with the given information.



Thanks for your help Ralph. in the end it was necessary to temporarily set MAVEN_HOME via my build script. This solved the problem

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,141
× 564
× 458

Question asked: Oct 19 '12, 12:51 p.m.

Question was seen: 6,050 times

Last updated: Oct 22 '12, 4:35 p.m.

Confirmation Cancel Confirm