http://jira.codehaus.org/secure/IssueNavigator.jspa? reset=true&mode=hide&pid=10500&sorter/order=DESC&sorter/ field=priority&resolution=-1&component=11982

On 12 Feb 07, at 5:11 PM 12 Feb 07, Tomasz Pik wrote:

Hello,

After running some tests I've found that on Windows
maven-invoker-plugin is not handling errors correctly.
POMs for invoked projects may be broken and m-i-p
still reports them as success.
There's a couple of resolved issues in MNG JIRA
related to exit error code on windows and currently
mvn.bat contains
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
which means, that if mvn.bat will be invoked with
MAVEN_TERMINATE_CMD environment variable
set to 'on', then script will return non-zero code
if build will fail. Which is exactly as expected...
.. as long, as script is being invoked with this variable
being set.
But mvn.bat invoked from DefaultInvoker is invoked
without any changes in environment so without this
variable being set by default.
Using 'exit %ERROR_CODE%' means also, that 'cmd'
running maven will also be closed so it's not too practical
for windows users to set this value - they needs to open
new window every time so it's not a good idea to set
MAVEN_TERMINATE_CMD=on as global value.
So - to make all of this working as expected (to make
maven-invoker-plugin reports failed tests as failures)
cli.addEnvironment("MAVEN_TERMINATE_CMD", "on");
needs to be added to DefaultInvoker.
Where in JIRA I should added this as an issue?

Regards,
Tomek

PS I've also found a more practical workaround :)
remove /B in last line of mvn.bat and use cygwin to
run 'mvn' shell script. So main maven execution is
controlled by cygwin and child executions are controlled
by mvn.bat, which returns error code as expected.
Probably mvn.bat may set up this variable before executing
java so child executions will return exit codes and main script
(the same script, main execution in fact) will use global value?
WDYT?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to