continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r216139 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Date Wed, 13 Jul 2005 11:17:07 GMT
Author: evenisse
Date: Wed Jul 13 04:17:03 2005
New Revision: 216139

URL: http://svn.apache.org/viewcvs?rev=216139&view=rev
Log:
Find and use always the correct continuum version

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java?rev=216139&r1=216138&r2=216139&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Wed Jul 13 04:17:03 2005
@@ -17,9 +17,11 @@
  */
 
 import java.io.File;
+import java.io.InputStream;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
@@ -51,8 +53,6 @@
     extends AbstractLogEnabled
     implements ContinuumCore, Initializable, Startable
 {
-    private final static String CONTINUUM_VERSION = "1.0-alpha-2-SNAPSHOT";
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -393,11 +393,11 @@
         //
         // ----------------------------------------------------------------------
 
-        String banner = StringUtils.repeat( "-", CONTINUUM_VERSION.length() );
+        String banner = StringUtils.repeat( "-", getVersion().length() );
 
         getLogger().info( "" );
         getLogger().info( "" );
-        getLogger().info( "< Continuum " + CONTINUUM_VERSION + " started! >" );
+        getLogger().info( "< Continuum " + getVersion() + " started! >" );
         getLogger().info( "-----------------------" + banner );
         getLogger().info( "       \\   ^__^" );
         getLogger().info( "        \\  (oo)\\_______" );
@@ -459,6 +459,24 @@
     public String getWorkingDirectory()
     {
         return workingDirectory;
+    }
+
+    private String getVersion()
+    {
+        InputStream resourceAsStream;
+        try
+        {
+            Properties properties = new Properties();
+            resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(
+                "META-INF/maven/org.apache.maven.continuum/continuum-core/pom.properties"
);
+            properties.load( resourceAsStream );
+
+            return properties.getProperty( "version", "unknown" );
+        }
+        catch ( Exception e )
+        {
+            return "unknown";
+        }
     }
 }
 



Mime
View raw message