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.



git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1151924 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2011-07-28 16:46:23 +00:00
parent 0ffb849a06
commit ef62188881
5 changed files with 25 additions and 4 deletions

View File

@ -30,6 +30,10 @@
<name>Maven Distribution</name> <name>Maven Distribution</name>
<description>Module to build the Maven distribution, source and binary, in zip and tar.gz formats.</description> <description>Module to build the Maven distribution, source and binary, in zip and tar.gz formats.</description>
<properties>
<distributionName>apache-maven</distributionName>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
@ -67,6 +71,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>${distributionId}-${project.version}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -31,9 +31,12 @@ END SNIPPET: ant-bootstrap -->
<project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant"> <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" /> <property name="it.workdir.version" value="3.0.x" />
<target name="initTaskDefs"> <target name="initTaskDefs">
<echo>Building ${distributionName} ...</echo>
<xmlproperty file="pom.xml" prefix="xmlPom" /> <xmlproperty file="pom.xml" prefix="xmlPom" />
<path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.1.jar" /> <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" /> <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"> <target name="init" depends="isMavenHomeSet">
<!-- Initialize properties --> <!-- Initialize properties -->
<property name="maven.home.basename.expected" value="apache-maven-${xmlPom.project.version}" /> <property name="maven.home.basename.expected" value="${distributionName}-${xmlPom.project.version}" />
<property name="maven.assembly" location="apache-maven/target/${maven.home.basename.expected}-bin.zip" /> <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.repo.local" value="${user.home}/.m2/repository" />
<property name="maven.debug" value="-e" /> <property name="maven.debug" value="-e" />
<property name="maven.test.skip" value="false" /> <property name="maven.test.skip" value="false" />
@ -83,6 +86,9 @@ Do you want to continue?</input>
<property name="maven.goal" value="install" /> <property name="maven.goal" value="install" />
<echo>maven.home = ${maven.home}</echo> <echo>maven.home = ${maven.home}</echo>
<echo>maven.repo.local = ${maven.repo.local}</echo> <echo>maven.repo.local = ${maven.repo.local}</echo>
<echo>distributionId = ${distributionId}</echo>
<echo>distributionName = ${distributionName}</echo>
<echo>distributionDirectory = ${distributionDirectory}</echo>
</target> </target>
<target name="clean-bootstrap" description="cleans up generated bootstrap classes"> <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="-Dmaven.repo.local=${maven.repo.local}" />
<arg value="-Dsurefire.useFile=${surefire.useFile}" /> <arg value="-Dsurefire.useFile=${surefire.useFile}" />
<arg value="-Dmaven.test.redirectTestOutputToFile=${maven.test.redirectTestOutputToFile}" /> <arg value="-Dmaven.test.redirectTestOutputToFile=${maven.test.redirectTestOutputToFile}" />
<arg value="-DdistributionName=${distributionName}" />
</java> </java>
</target> </target>

View File

@ -1,3 +1,6 @@
buildNumber=${buildNumber} buildNumber=${buildNumber}
timestamp=${timestamp} timestamp=${timestamp}
version=${project.version} version=${project.version}
distributionId=${distributionId}
distributionShortName=${distributionShortName}
distributionName=${distributionName}

View File

@ -54,8 +54,9 @@ public final class CLIReportingUtils
{ {
Properties properties = getBuildProperties(); Properties properties = getBuildProperties();
stdout.println( createMavenVersionString( properties ) ); 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>" ) stdout.println( "Java version: " + System.getProperty( "java.version", "<unknown java version>" )
+ ", vendor: " + System.getProperty( "java.vendor", "<unknown vendor>" ) ); + ", vendor: " + System.getProperty( "java.vendor", "<unknown vendor>" ) );
@ -80,8 +81,9 @@ public final class CLIReportingUtils
String timestamp = reduce( buildProperties.getProperty( "timestamp" ) ); String timestamp = reduce( buildProperties.getProperty( "timestamp" ) );
String version = reduce( buildProperties.getProperty( BUILD_VERSION_PROPERTY ) ); String version = reduce( buildProperties.getProperty( BUILD_VERSION_PROPERTY ) );
String rev = reduce( buildProperties.getProperty( "buildNumber" ) ); 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>" ); msg += ( version != null ? version : "<version unknown>" );
if ( rev != null || timestamp != null ) if ( rev != null || timestamp != null )
{ {

View File

@ -52,6 +52,10 @@
<jxpathVersion>1.3</jxpathVersion> <jxpathVersion>1.3</jxpathVersion>
<aetherVersion>1.11</aetherVersion> <aetherVersion>1.11</aetherVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile> <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> </properties>
<mailingLists> <mailingLists>