added verbose mode activated with MVNW_VERBOSE set to true

This commit is contained in:
Manfred Moser 2017-09-12 11:33:43 -07:00 committed by rfscholte
parent 59ffd080f5
commit 70f1adc9f8
4 changed files with 24 additions and 3 deletions

View File

@ -3,12 +3,17 @@
The [git commit history](https://github.com/takari/maven-wrapper/commits/master) is the detailed source of all changes. 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. 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 - Print out Maven Wrapper version with each invocation
- see https://github.com/takari/maven-wrapper/pull/48 - see https://github.com/takari/maven-wrapper/pull/48
- contributed by Tadaya Tsuyukubo - https://github.com/ttddyy - 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 ## Version 0.2.1 - 2017-04-21

View File

@ -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. 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 ## Using a Different Version of Maven
To switch the version of Maven used to build a project you can initialize it using To switch the version of Maven used to build a project you can initialize it using

4
maven-wrapper/mvnw vendored
View File

@ -201,7 +201,9 @@ if [ -z "$BASE_DIR" ]; then
fi fi
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 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" MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java # For Cygwin, switch paths to Windows format before running java

View File

@ -36,13 +36,20 @@ public class MavenWrapperMain {
public static final String MAVEN_USER_HOME_ENV_KEY = "MAVEN_USER_HOME"; 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 { public static void main(String[] args) throws Exception {
Boolean verbose = System.getenv(MVNW_VERBOSE).equalsIgnoreCase("true");
File wrapperJar = wrapperJar(); File wrapperJar = wrapperJar();
File propertiesFile = wrapperProperties(wrapperJar); File propertiesFile = wrapperProperties(wrapperJar);
File rootDir = rootDir(wrapperJar); File rootDir = rootDir(wrapperJar);
String wrapperVersion = wrapperVersion(); String wrapperVersion = wrapperVersion();
System.out.println("Takari Maven Wrapper " + wrapperVersion);
if (verbose) {
System.out.println("Takari Maven Wrapper " + wrapperVersion);
}
Properties systemProperties = System.getProperties(); Properties systemProperties = System.getProperties();
systemProperties.putAll(parseSystemPropertiesFromArgs(args)); systemProperties.putAll(parseSystemPropertiesFromArgs(args));