o merged from r633053 (fixed potential NPE)

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@633054 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2008-03-03 12:09:01 +00:00
parent b19a751704
commit 80a6818f01
1 changed files with 15 additions and 7 deletions

View File

@ -53,6 +53,9 @@ public final class CLIReportingUtils
Properties properties = new Properties(); Properties properties = new Properties();
resourceAsStream = MavenCli.class.getClassLoader() resourceAsStream = MavenCli.class.getClassLoader()
.getResourceAsStream( "META-INF/maven/org.apache.maven/maven-core/pom.properties" ); .getResourceAsStream( "META-INF/maven/org.apache.maven/maven-core/pom.properties" );
if ( resourceAsStream != null )
{
properties.load( resourceAsStream ); properties.load( resourceAsStream );
if ( properties.getProperty( "builtOn" ) != null ) if ( properties.getProperty( "builtOn" ) != null )
@ -66,6 +69,11 @@ public final class CLIReportingUtils
System.out.println( "Maven version: " System.out.println( "Maven version: "
+ properties.getProperty( "version", "unknown" ) ); + properties.getProperty( "version", "unknown" ) );
} }
}
else
{
System.out.println( "Maven version: unknown" );
}
System.out.println( "Java version: " System.out.println( "Java version: "
+ System.getProperty( "java.version", "<unknown java version>" ) ); + System.getProperty( "java.version", "<unknown java version>" ) );