You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/07/25 22:41:50 UTC

[maven] branch MNG-7075 created (now 4dfd287)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch MNG-7075
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 4dfd287  [MNG-7075] mvnDebug --version should only show version info

This branch includes the following new commits:

     new 4dfd287  [MNG-7075] mvnDebug --version should only show version info

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[maven] 01/01: [MNG-7075] mvnDebug --version should only show version info

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MNG-7075
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 4dfd287ecf1df38ac833f2e90f9f43ce4ea5077a
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon Jul 26 00:38:57 2021 +0200

    [MNG-7075] mvnDebug --version should only show version info
    
    This closes #515
---
 apache-maven/src/assembly/maven/bin/mvnDebug     | 15 +++++++++++++--
 apache-maven/src/assembly/maven/bin/mvnDebug.cmd | 16 +++++++++++++---
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/apache-maven/src/assembly/maven/bin/mvnDebug b/apache-maven/src/assembly/maven/bin/mvnDebug
index 7c8d327..f6f481f 100644
--- a/apache-maven/src/assembly/maven/bin/mvnDebug
+++ b/apache-maven/src/assembly/maven/bin/mvnDebug
@@ -28,8 +28,19 @@
 #   MAVEN_DEBUG_ADDRESS (Optional) Set the debug address. Default value is localhost:8000
 # -----------------------------------------------------------------------------
 
-MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${MAVEN_DEBUG_ADDRESS:-localhost:8000}"
+found_informative_switch=0
+for arg in "$@"; do
+  if [ "$arg" = "-v" -o "$arg" = "--version" \
+       -o "$arg" = "-h" -o "$arg" = "--help" ]; then
+    found_informative_switch=1
+    break
+  fi
+done
 
-echo Preparing to execute Maven in debug mode
+if [ $found_informative_switch -eq 0 ] ; then
+  MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${MAVEN_DEBUG_ADDRESS:-localhost:8000}"
+
+  echo Preparing to execute Maven in debug mode
+fi
 
 env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "`dirname "$0"`/mvn" "$@"
diff --git a/apache-maven/src/assembly/maven/bin/mvnDebug.cmd b/apache-maven/src/assembly/maven/bin/mvnDebug.cmd
index f02e89c..7df863b 100644
--- a/apache-maven/src/assembly/maven/bin/mvnDebug.cmd
+++ b/apache-maven/src/assembly/maven/bin/mvnDebug.cmd
@@ -37,8 +37,18 @@ title %0
 
 @setlocal
 
-if "%MAVEN_DEBUG_ADDRESS%"=="" @set MAVEN_DEBUG_ADDRESS=localhost:8000
+for %%a in (%*) do (
+  if "%%a" == "-v" goto runMvnCmd
+  if "%%a" == "--version" goto runMvnCmd
+  if "%%a" == "-h" goto runMvnCmd
+  if "%%a" == "--help" goto runMvnCmd
+)
+goto setDebugFlags
 
-@set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%MAVEN_DEBUG_ADDRESS%
+:setDebugFlags
+if "%MAVEN_DEBUG_ADDRESS%"=="" set MAVEN_DEBUG_ADDRESS=localhost:8000
 
-@call "%~dp0"mvn.cmd %*
+set MAVEN_DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%MAVEN_DEBUG_ADDRESS%
+
+:runMvnCmd
+call "%~dp0"mvn.cmd %*