maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Patrick <robert.patr...@oracle.com>
Subject RE: Maven 3.3.1 Script Bug
Date Sun, 05 Apr 2015 18:40:39 GMT
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 <robert.patrick@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


Mime
View raw message