maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r425105 - in /maven/components/trunk: bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java
Date Mon, 24 Jul 2006 16:04:09 GMT
Author: carlos
Date: Mon Jul 24 09:04:09 2006
New Revision: 425105

URL: http://svn.apache.org/viewvc?rev=425105&view=rev
Log:
Use constants for maven groupId

Modified:
    maven/components/trunk/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java

Modified: maven/components/trunk/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java?rev=425105&r1=425104&r2=425105&view=diff
==============================================================================
--- maven/components/trunk/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java
(original)
+++ maven/components/trunk/bootstrap/bootstrap-installer/src/main/java/org/apache/maven/bootstrap/installer/BootstrapInstaller.java
Mon Jul 24 09:04:09 2006
@@ -43,6 +43,8 @@
  */
 public class BootstrapInstaller
 {
+    private static final String MAVEN_GROUPID = "org.apache.maven";
+
     private final Bootstrap bootstrapper;
 
     private final String prefix;
@@ -117,7 +119,7 @@
 
         bootstrapper.buildProject( new File( basedir ), true );
 
-        Model mavenCliModel = bootstrapper.getCachedModel( "org.apache.maven", "maven-cli"
);
+        Model mavenCliModel = bootstrapper.getCachedModel( MAVEN_GROUPID, "maven-cli" );
 
         File installation = new File( basedir, "bootstrap/target/installation" );
         createInstallation( installation, mavenCliModel );

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java?rev=425105&r1=425104&r2=425105&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java
Mon Jul 24 09:04:09 2006
@@ -35,6 +35,10 @@
 public class DefaultRuntimeInformation
     implements RuntimeInformation, Initializable
 {
+    private static final String MAVEN_GROUPID = "org.apache.maven";
+    
+    private static final String MAVEN_PROPERTIES = "META-INF/maven/" + MAVEN_GROUPID + "/maven-core/pom.properties";
+
     private ArtifactVersion applicationVersion;
 
     public ArtifactVersion getApplicationVersion()
@@ -49,8 +53,12 @@
         try
         {
             Properties properties = new Properties();
-            resourceAsStream = getClass().getClassLoader().getResourceAsStream(
-                "META-INF/maven/org.apache.maven/maven-core/pom.properties" );
+            resourceAsStream = getClass().getClassLoader().getResourceAsStream( MAVEN_PROPERTIES
);
+            
+            if ( resourceAsStream == null )
+            {
+                throw new IllegalStateException( "Unable to find Maven properties in classpath:
" + MAVEN_PROPERTIES );
+            }
             properties.load( resourceAsStream );
 
             String property = properties.getProperty( "version" );



Mime
View raw message