You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2015/04/05 17:41:32 UTC

Maven 3.3.1 Script Bug

Hi,

based on some comments 
(http://blog.soebes.de/blog/2015/03/17/apache-maven-3-dot-3-1-features/#disqus_thread) 
on my site it looks like we have a bug in the debug scripts which do not 
correctly export the variables to the underlying mvn scripts...

mvnDebug.cmd

@setlocal

will prevent exporting the environment variable to the sub calling 
mvn.cmd file...

furthermore in mvnDebug the call "env ..." will do the same ? (I'm not 
sure about) can someone acknowledge this with more knowledge about this?


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: Maven 3.3.1 Script Bug

Posted by Robert Patrick <ro...@oracle.com>.
Sorry for butting in but...

In Windows, I see that mvnDebug.cmd sets the MAVEN_DEBUG_OPTS variable and calls mvn.cmd.  In mvn.cmd, MAVEN_DEBUG_OPTS referenced directly on the java command-line:

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%

As such, anything that sets/overrides MAVEN_OPTS will not lose the Java debug arguments.

In Linux/Unix, I see that mvnDebug isnot passing MAVEN_DEBUG_OPTS to the mvn script but is concatenating it with the current MAVEN_OPTS value before calling mvn.  In mvn, there is no reference to MAVEN_DEBUG_OPTS so anything that overwrites MAVEN_OPTS will lose the Java debug arguments.  For example, if one of the mavenrc files defines MAVEN_OPTS, the debug variables will be lost:

  if [ -f /etc/mavenrc ] ; then
    . /etc/mavenrc
  fi

  if [ -f "$HOME/.mavenrc" ] ; then
    . "$HOME/.mavenrc"
  fi

Is there a reason that you chose to include the MAVEN_DEBUG_OPTS variable usage in mvn.cmd but not in mvn (Unix sh script)?  It seems to me that the mvnDebug should pass the Java debug arguments to mvn using MAVEN_DEBUIGH_OPTS--just like it does in Windows... 

What am I missing?
Robert

--
Robert Patrick <ro...@oracle.com>
VP, Oracle Corporation
7460 Warren Pkwy, Ste. 300	Office: +1.972.963.2872
Frisco, TX 75034, USA		Mobile: +1.469.556.9450

Professional Oracle WebLogic Server
by Robert Patrick, Gregory Nyberg, and Philip Aston
with Josh Bregman and Paul Done
Book Home Page: http://www.wrox.com/
Kindle Version: http://www.amazon.com/


-----Original Message-----
From: Andreas Gudian [mailto:andreas.gudian@gmail.com] 
Sent: Sunday, April 05, 2015 12:17 PM
To: Maven Developers List; info@soebes.de
Subject: Re: Maven 3.3.1 Script Bug

If I read that right, there is a problem in the shell scripts, not the windows cmd script, right? Because mvnDebug.cmd works for me as expected.



Am Sonntag, 5. April 2015 schrieb Karl Heinz Marbaise :

> Hi,
>
> based on some comments (http://blog.soebes.de/blog/
> 2015/03/17/apache-maven-3-dot-3-1-features/#disqus_thread) on my site 
> it looks like we have a bug in the debug scripts which do not 
> correctly export the variables to the underlying mvn scripts...
>
> mvnDebug.cmd
>
> @setlocal
>
> will prevent exporting the environment variable to the sub calling 
> mvn.cmd file...
>
> furthermore in mvnDebug the call "env ..." will do the same ? (I'm not 
> sure about) can someone acknowledge this with more knowledge about this?
>
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For 
> additional commands, e-mail: dev-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Maven 3.3.1 Script Bug

Posted by Andreas Gudian <an...@gmail.com>.
If I read that right, there is a problem in the shell scripts, not the
windows cmd script, right? Because mvnDebug.cmd works for me as expected.



Am Sonntag, 5. April 2015 schrieb Karl Heinz Marbaise :

> Hi,
>
> based on some comments (http://blog.soebes.de/blog/
> 2015/03/17/apache-maven-3-dot-3-1-features/#disqus_thread) on my site it
> looks like we have a bug in the debug scripts which do not correctly export
> the variables to the underlying mvn scripts...
>
> mvnDebug.cmd
>
> @setlocal
>
> will prevent exporting the environment variable to the sub calling mvn.cmd
> file...
>
> furthermore in mvnDebug the call "env ..." will do the same ? (I'm not
> sure about) can someone acknowledge this with more knowledge about this?
>
>
> Kind regards
> Karl Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>