[MNG-5756] Java home output in mvn -v is misleading

The Java home displayed corresponds to the property 'java.home' which points to
the JRE installation running the given Maven instance. It is not the value of
$JAVA_HOME which causes confusion.

Ref: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

This closes #115 and #117.
This commit is contained in:
Michael Osipov 2018-05-06 00:01:55 +02:00
parent 8e0efaa107
commit 9abfc88425
1 changed files with 3 additions and 4 deletions

View File

@ -63,12 +63,11 @@ public final class CLIReportingUtils
properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home", properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home",
"<unknown Maven " "<unknown Maven "
+ "home>" ) ) ) + "home>" ) ) )
.append( .append( ls );
ls );
version.append( "Java version: " ).append( version.append( "Java version: " ).append(
System.getProperty( "java.version", "<unknown Java version>" ) ).append( ", vendor: " ).append( System.getProperty( "java.version", "<unknown Java version>" ) ).append( ", vendor: " ).append(
System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ls ); System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ", runtime: " ).append(
version.append( "Java home: " ).append( System.getProperty( "java.home", "<unknown Java home>" ) ).append( ls ); System.getProperty( "java.home", "<unknown runtime>" ) ).append( ls );
version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append( version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append(
System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( ls ); System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( ls );
version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append( version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append(