diff --git a/maven-wrapper/CHANGELOG.md b/maven-wrapper/CHANGELOG.md index 33a84ff371..b4e55b8c33 100644 --- a/maven-wrapper/CHANGELOG.md +++ b/maven-wrapper/CHANGELOG.md @@ -3,12 +3,17 @@ The [git commit history](https://github.com/takari/maven-wrapper/commits/master) is the detailed source of all changes. The following provides most information at an easier glance. -## Version 0.2.2 or higher - Upcoming +## Version 0.2.2 - 2017-09-12 - Print out Maven Wrapper version with each invocation - see https://github.com/takari/maven-wrapper/pull/48 - contributed by Tadaya Tsuyukubo - https://github.com/ttddyy +- Verbose mode + - only print out basedir and version in verbose mode + - set by environment variable MVNW_VERBOSE="true" + - onctributed by Manfred Moser - http://www.simpligility.com +Release performed by Manfred Moser - http://www.simpligility.com ## Version 0.2.1 - 2017-04-21 diff --git a/maven-wrapper/README.md b/maven-wrapper/README.md index c0914feab4..80409b7c80 100644 --- a/maven-wrapper/README.md +++ b/maven-wrapper/README.md @@ -60,6 +60,13 @@ This is however not really tested by the committers. Please check out the [changelog](./CHANGELOG.md) for more information about our releases. +## Verbose Mode + +The wrapper supports a verbose mode in which it outputs further information. It +is activated by setting the MVNW_VERBOSE environment variable to `true`. + +By default it is off. + ## Using a Different Version of Maven To switch the version of Maven used to build a project you can initialize it using diff --git a/maven-wrapper/mvnw b/maven-wrapper/mvnw index b07b8f82dc..e96ccd5fbb 100755 --- a/maven-wrapper/mvnw +++ b/maven-wrapper/mvnw @@ -201,7 +201,9 @@ if [ -z "$BASE_DIR" ]; then fi export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -echo $MAVEN_PROJECTBASEDIR +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java diff --git a/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java b/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java index 92c6dedcbc..16814c00b3 100644 --- a/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java +++ b/maven-wrapper/src/main/java/org/apache/maven/wrapper/MavenWrapperMain.java @@ -36,13 +36,20 @@ public class MavenWrapperMain { public static final String MAVEN_USER_HOME_ENV_KEY = "MAVEN_USER_HOME"; + public static final String MVNW_VERBOSE = "MVNW_VERBOSE"; + public static void main(String[] args) throws Exception { + Boolean verbose = System.getenv(MVNW_VERBOSE).equalsIgnoreCase("true"); + File wrapperJar = wrapperJar(); File propertiesFile = wrapperProperties(wrapperJar); File rootDir = rootDir(wrapperJar); String wrapperVersion = wrapperVersion(); - System.out.println("Takari Maven Wrapper " + wrapperVersion); + + if (verbose) { + System.out.println("Takari Maven Wrapper " + wrapperVersion); + } Properties systemProperties = System.getProperties(); systemProperties.putAll(parseSystemPropertiesFromArgs(args));