You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2011/07/28 18:46:25 UTC

svn commit: r1151924 - in /maven/maven-3/trunk: apache-maven/pom.xml build.xml maven-core/src/main/resources/org/apache/maven/messages/build.properties maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java pom.xml

Author: jvanzyl
Date: Thu Jul 28 16:46:23 2011
New Revision: 1151924

URL: http://svn.apache.org/viewvc?rev=1151924&view=rev
Log:
o make it possible to change:
 - the overarching archive name
 - id of the product
 - long name of the product
 - short name of the product
 - have "mvn -v" output this information so that it's clear it's not Apache Maven

This allows people in the community creating builds of their own builds of Apache Maven to conform to the naming conventions put forth by the Apache Software Foundation.


Modified:
    maven/maven-3/trunk/apache-maven/pom.xml
    maven/maven-3/trunk/build.xml
    maven/maven-3/trunk/maven-core/src/main/resources/org/apache/maven/messages/build.properties
    maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
    maven/maven-3/trunk/pom.xml

Modified: maven/maven-3/trunk/apache-maven/pom.xml
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/apache-maven/pom.xml?rev=1151924&r1=1151923&r2=1151924&view=diff
==============================================================================
--- maven/maven-3/trunk/apache-maven/pom.xml (original)
+++ maven/maven-3/trunk/apache-maven/pom.xml Thu Jul 28 16:46:23 2011
@@ -30,6 +30,10 @@
   <name>Maven Distribution</name>
   <description>Module to build the Maven distribution, source and binary, in zip and tar.gz formats.</description>
 
+  <properties>
+    <distributionName>apache-maven</distributionName>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -67,6 +71,7 @@
   </dependencies>
 
   <build>
+    <finalName>${distributionId}-${project.version}</finalName>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

Modified: maven/maven-3/trunk/build.xml
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/build.xml?rev=1151924&r1=1151923&r2=1151924&view=diff
==============================================================================
--- maven/maven-3/trunk/build.xml (original)
+++ maven/maven-3/trunk/build.xml Thu Jul 28 16:46:23 2011
@@ -31,9 +31,12 @@ END SNIPPET: ant-bootstrap -->
 
 <project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant">
 
+  <property name="distributionDirectory" value="apache-maven"/>
+  <property name="distributionName" value="apache-maven"/>
   <property name="it.workdir.version" value="3.0.x" />
 
   <target name="initTaskDefs">
+    <echo>Building ${distributionName} ...</echo>
     <xmlproperty file="pom.xml" prefix="xmlPom" />
     <path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.1.jar" />
     <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
@@ -72,8 +75,8 @@ Do you want to continue?</input>
 
   <target name="init" depends="isMavenHomeSet">
     <!-- Initialize properties -->
-    <property name="maven.home.basename.expected" value="apache-maven-${xmlPom.project.version}" />
-    <property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip" />
+    <property name="maven.home.basename.expected" value="${distributionName}-${xmlPom.project.version}" />
+    <property name="maven.assembly" location="${distributionDirectory}/target/${maven.home.basename.expected}-bin.zip" />
     <property name="maven.repo.local" value="${user.home}/.m2/repository" />
     <property name="maven.debug" value="-e" />
     <property name="maven.test.skip" value="false" />
@@ -83,6 +86,9 @@ Do you want to continue?</input>
     <property name="maven.goal" value="install" />
     <echo>maven.home = ${maven.home}</echo>
     <echo>maven.repo.local = ${maven.repo.local}</echo>
+    <echo>distributionId = ${distributionId}</echo>
+    <echo>distributionName = ${distributionName}</echo>
+    <echo>distributionDirectory = ${distributionDirectory}</echo>
   </target>
 
   <target name="clean-bootstrap" description="cleans up generated bootstrap classes">
@@ -252,6 +258,7 @@ Do you want to continue?</input>
       <arg value="-Dmaven.repo.local=${maven.repo.local}" />
       <arg value="-Dsurefire.useFile=${surefire.useFile}" />
       <arg value="-Dmaven.test.redirectTestOutputToFile=${maven.test.redirectTestOutputToFile}" />
+      <arg value="-DdistributionName=${distributionName}" />
     </java>
   </target>
 

Modified: maven/maven-3/trunk/maven-core/src/main/resources/org/apache/maven/messages/build.properties
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/resources/org/apache/maven/messages/build.properties?rev=1151924&r1=1151923&r2=1151924&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/resources/org/apache/maven/messages/build.properties (original)
+++ maven/maven-3/trunk/maven-core/src/main/resources/org/apache/maven/messages/build.properties Thu Jul 28 16:46:23 2011
@@ -1,3 +1,6 @@
 buildNumber=${buildNumber}
 timestamp=${timestamp}
 version=${project.version}
+distributionId=${distributionId}
+distributionShortName=${distributionShortName}
+distributionName=${distributionName}
\ No newline at end of file

Modified: maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java?rev=1151924&r1=1151923&r2=1151924&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java (original)
+++ maven/maven-3/trunk/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java Thu Jul 28 16:46:23 2011
@@ -54,8 +54,9 @@ public final class CLIReportingUtils
     {
         Properties properties = getBuildProperties();
         stdout.println( createMavenVersionString( properties ) );
+        String shortName = reduce( properties.getProperty( "distributionShortName" ) );
 
-        stdout.println( "Maven home: " + System.getProperty( "maven.home", "<unknown maven home>" ) );
+        stdout.println( shortName + " home: " + System.getProperty( "maven.home", "<unknown maven home>" ) );
 
         stdout.println( "Java version: " + System.getProperty( "java.version", "<unknown java version>" )
             + ", vendor: " + System.getProperty( "java.vendor", "<unknown vendor>" ) );
@@ -80,8 +81,9 @@ public final class CLIReportingUtils
         String timestamp = reduce( buildProperties.getProperty( "timestamp" ) );
         String version = reduce( buildProperties.getProperty( BUILD_VERSION_PROPERTY ) );
         String rev = reduce( buildProperties.getProperty( "buildNumber" ) );
+        String distributionName = reduce( buildProperties.getProperty( "distributionName" ) );
 
-        String msg = "Apache Maven ";
+        String msg = distributionName + " ";
         msg += ( version != null ? version : "<version unknown>" );
         if ( rev != null || timestamp != null )
         {

Modified: maven/maven-3/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/pom.xml?rev=1151924&r1=1151923&r2=1151924&view=diff
==============================================================================
--- maven/maven-3/trunk/pom.xml (original)
+++ maven/maven-3/trunk/pom.xml Thu Jul 28 16:46:23 2011
@@ -52,6 +52,10 @@
     <jxpathVersion>1.3</jxpathVersion>
     <aetherVersion>1.11</aetherVersion>
     <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
+    <!-- Control the name of the distribtion and information output by mvn -->
+    <distributionId>apache-maven</distributionId>
+    <distributionShortName>Maven</distributionShortName>
+    <distributionName>Apache Maven</distributionName>
   </properties>
 
   <mailingLists>