tags:

views:

24

answers:

2

Hello, I want to create a project *free style* using Hudson and i want to execute in it commands that installs jar in the repository of Maven by using : mvn install:install-file When i put one command it works but when i put more that one command:

mvn install:install-file

mvn install:install-file

Hudson executes the first command only!!

Who has a solution for this please?

A: 

Why don't you setup separate jobs in Hudson, and add a post build action on the first one to kick off the second, or a trigger on the second to kick-off after the first job completes.

crowne
A: 

I have 120 jar file, it only runs the first one and exits to the command prompt. So i've found a solution : by using the call command for each call to mvn like this:

call mvn install:install-file ... call mvn install:install-file ...

By this method you can put many commands Maven in only one project free style in Hudson.

Rayouma
The reason for this behavior is the last line in the `mvn.bat` - `exit /B %ERROR_CODE%`. `exit /B` ends the current batch file context. If you call a batch file from another batch file (this is what Hudson does) it will only create a new batch file context when you use the `call` command. Be careful with the the use of `exit` without the `/b` parameter. It will then end the current command shell.
Peter Schuetze