[MNG-5904] Remove the whole Ant build

This commit is contained in:
Karl Heinz Marbaise 2015-12-11 19:41:02 +01:00 committed by Hervé Boutemy
parent be5caccaff
commit 8b66162052
9 changed files with 184 additions and 382 deletions

View File

@ -12,12 +12,12 @@ Maven is available under the [Apache License, Version 2.0](http://www.apache.org
If you want to bootstrap Maven, you'll need:
- Java 1.7+
- Ant 1.8 or later
- Maven 3.0.5 or later
Run Ant, specifying a location into which the completed Maven distro should be installed:
Run Maven, specifying a location into which the completed Maven distro should be installed:
```
ant -Dmaven.home="$HOME/apps/maven/apache-maven-3.3.x-SNAPSHOT"
mvn -DdistributionTargetDir="$HOME/app/maven/apache-maven-3.5.x-SNAPSHOT" clean package
```
Once the build completes, you should have a new Maven distro ready to roll in that directory!

View File

@ -16,7 +16,7 @@
Release Notes
-------------
The full list of changes can be found at http://maven.apache.org/release-notes.html.
The full list of changes can be found at http://maven.apache.org/docs/history.html.
System Requirements
-------------------

View File

@ -151,7 +151,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-distro</id>
<id>create-distro-packages</id>
<phase>package</phase>
<goals>
<goal>single</goal>
@ -181,6 +181,59 @@
</pluginRepositories>
<profiles>
<profile>
<id>create-distribution-in-dir</id>
<activation>
<property>
<name>distributionTargetDir</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>clean</goal>
</goals>
<id>clean-target-dir</id>
<phase>prepare-package</phase>
<configuration>
<filesets>
<fileset>
<directory>${distributionTargetDir}</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-distribution-dir</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>./</finalName>
<appendAssemblyId>false</appendAssemblyId>
<attach>false</attach>
<outputDirectory>${distributionTargetDir}</outputDirectory>
<descriptors>
<descriptor>src/main/assembly/dir.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>apache-release</id>
<build>

View File

@ -17,78 +17,14 @@ specific language governing permissions and limitations
under the License.
-->
<assembly>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>bin</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>boot</outputDirectory>
<includes>
<include>org.codehaus.plexus:plexus-classworlds</include>
</includes>
</dependencySet>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>org.codehaus.plexus:plexus-classworlds</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<includes>
<include>README*</include>
</includes>
</fileSet>
<fileSet>
<directory>target/maven-shared-archive-resources/META-INF</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>target/licenses/lib</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet>
<directory>src/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>*.cmd</include>
<include>*.conf</include>
</includes>
<lineEnding>dos</lineEnding>
</fileSet>
<fileSet>
<directory>src/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>m2</include>
<include>mvn</include>
<include>mvnDebug</include>
<!-- This is so that CI systems can periodically run the profiler -->
<include>mvnyjp</include>
</includes>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/conf</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>src/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
</fileSets>
<componentDescriptors>
<componentDescriptor>src/main/assembly/component.xml</componentDescriptor>
</componentDescriptors>
</assembly>

View File

@ -0,0 +1,89 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3 http://maven.apache.org/xsd/component-1.1.3.xsd">
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>boot</outputDirectory>
<includes>
<include>org.codehaus.plexus:plexus-classworlds</include>
</includes>
</dependencySet>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>org.codehaus.plexus:plexus-classworlds</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<includes>
<include>README*</include>
</includes>
</fileSet>
<fileSet>
<directory>target/maven-shared-archive-resources/META-INF</directory>
<outputDirectory>./</outputDirectory>
<includes>
<include>LICENSE</include>
<include>NOTICE</include>
</includes>
</fileSet>
<fileSet>
<directory>target/licenses/lib</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet>
<directory>src/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>*.cmd</include>
<include>*.conf</include>
</includes>
<lineEnding>dos</lineEnding>
</fileSet>
<fileSet>
<directory>src/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>m2</include>
<include>mvn</include>
<include>mvnDebug</include>
<!-- This is so that CI systems can periodically run the profiler -->
<include>mvnyjp</include>
</includes>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/conf</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>src/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
</fileSets>
</component>

View File

@ -0,0 +1,30 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>dir</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<componentDescriptors>
<componentDescriptor>src/main/assembly/component.xml</componentDescriptor>
</componentDescriptors>
</assembly>

View File

@ -17,7 +17,8 @@ specific language governing permissions and limitations
under the License.
-->
<assembly>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>src</id>
<formats>
<format>zip</format>

307
build.xml
View File

@ -1,307 +0,0 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!-- START SNIPPET: ant-bootstrap
By default the bootstrap will use ~/.m2/repository as the integration repository but you can define the integration
repository by specifying a property on the command line:
ant -Dmaven.repo.local=/my/integration/repository
Those familiar with Maven will note this is the same way the local repository can be set from the command-line.
This facilitates having a set of builds converge on the same repository for integration purposes.
END SNIPPET: ant-bootstrap -->
<project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<property name="distributionDirectory" value="apache-maven"/>
<property name="distributionId" value="apache-maven"/>
<property name="distributionShortName" value="Maven"/>
<property name="distributionName" value="Apache Maven"/>
<property name="it.workdir.version" value="3.0.x" />
<property name="maven-compile.jvmargs" value="-Xmx512m -Xms512m"/>
<property name="maven-compile.fork" value="true"/>
<property name="maven-compile.maxmemory" value="512m"/>
<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" />
</target>
<target name="isMavenHomeSet" depends="initTaskDefs">
<property environment="env" />
<condition property="maven.home" value="${env.M2_HOME}">
<isset property="env.M2_HOME" />
</condition>
<fail message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script">
<condition>
<or>
<not>
<isset property="maven.home" />
</not>
<equals arg1="${maven.home}" arg2="" trim="true" />
</or>
</condition>
</fail>
<available property="maven.home.exists" file="${maven.home}" />
</target>
<target name="prompt-maven-home-exists" depends="isMavenHomeSet" if="maven.home.exists">
<input addproperty="maven.home.exists.continue" validargs="yes,no" defaultvalue="no">WARNING:
The specified target directory
${maven.home}
already exists. It will be deleted and overwritten by the build.
Do you want to continue?</input>
<fail message="Build was aborted by user">
<condition>
<equals arg1="${maven.home.exists.continue}" arg2="no" trim="true" casesensitive="false" />
</condition>
</fail>
</target>
<target name="init" depends="isMavenHomeSet">
<!-- Initialize properties -->
<property name="maven.home.basename.expected" value="${distributionId}-${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" />
<property name="skipTests" value="false" />
<property name="surefire.useFile" value="true" />
<property name="maven.test.redirectTestOutputToFile" value="${surefire.useFile}" />
<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">
<delete dir="bootstrap" />
</target>
<target name="pull" depends="init" unless="skip.pull">
<!-- Pull the dependencies that Maven needs to build -->
<copy file="pom.xml" tofile="dependencies.xml" />
<replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-start-comment--&gt;" value="&lt;!--" />
<replace file="${basedir}/dependencies.xml" token="&lt;!--bootstrap-end-comment--&gt;" value="--&gt;" />
<artifact:pom file="${basedir}/dependencies.xml" id="pom">
<localRepository path="${maven.repo.local}" />
</artifact:pom>
<artifact:dependencies pathId="pom.pathid" filesetId="pom.fileset" useScope="compile">
<localRepository path="${maven.repo.local}" />
<pom refid="pom" />
</artifact:dependencies>
<delete file="${basedir}/dependencies.xml" />
<!-- Pull the dependencies for Modello -->
<artifact:dependencies pathId="modello.pathid" filesetId="modello.fileset">
<localRepository path="${maven.repo.local}" />
<dependency groupId="org.codehaus.modello" artifactId="modello-maven-plugin" version="${pom.properties.modelloVersion}" />
</artifact:dependencies>
<!-- Pull the dependencies for the MetadataGenerator CLI -->
<artifact:dependencies pathId="pmdg.pathid" filesetId="pmdg.fileset">
<localRepository path="${maven.repo.local}" />
<dependency groupId="org.codehaus.plexus" artifactId="plexus-component-metadata" version="${pom.properties.plexusVersion}" />
</artifact:dependencies>
</target>
<target name="process-classes" depends="pull" description="generates plexus component metadata.">
<mkdir dir="${basedir}/bootstrap/target" />
<mkdir dir="${basedir}/bootstrap/target/classes" />
<path id="pmdg.classpath">
<path refid="maven.classpath" />
<path refid="pmdg.pathid" />
</path>
<echo>Using plexus version ${pom.properties.plexusVersion}</echo>
<java fork="true" classname="org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" failonerror="true">
<classpath refid="pmdg.classpath" />
<!-- We need to generate component descriptors from the maven-artifact sources which use javadoc annotations. -->
<arg value="--source" />
<arg value="${basedir}/maven-compat/src/main/java" />
<!-- We have separated the artifact handlers and lifecycle mappings into a separate file. -->
<arg value="--descriptors" />
<arg value="${basedir}/maven-core/src/main/resources/META-INF/plexus" />
<!-- Search the classes for annotations that we've compiled. -->
<arg value="--classes" />
<arg value="${basedir}/bootstrap/target/classes" />
<!-- We'll make one big fat components descriptor. -->
<arg value="--output" />
<arg value="${basedir}/bootstrap/target/classes/META-INF/plexus/components.xml" />
</java>
</target>
<target name="generate-sources" depends="pull" description="generates Java sources from Modello mdo model files">
<mkdir dir="bootstrap/target" />
<mkdir dir="bootstrap/target/generated-sources" />
<macrodef name="modello-single-mode">
<attribute name="file" />
<attribute name="mode" />
<attribute name="version" />
<sequential>
<java fork="true" classname="org.codehaus.modello.ModelloCli" failonerror="true">
<classpath refid="modello.pathid" />
<arg file="@{file}" />
<!-- model file -->
<arg value="@{mode}" />
<!-- output type -->
<arg file="bootstrap/target/generated-sources" />
<!-- output directory -->
<arg value="@{version}" />
<!-- model version -->
<arg value="false" />
<!-- package with version -->
<arg value="true" />
<!-- use Java 5 -->
<arg value="UTF-8" />
<!-- encoding -->
</java>
</sequential>
</macrodef>
<macrodef name="modello">
<attribute name="file" />
<attribute name="version" default="1.0.0" />
<sequential>
<echo taskname="modello" message="Generating sources for @{file}" />
<modello-single-mode file="@{file}" version="@{version}" mode="java" />
<modello-single-mode file="@{file}" version="@{version}" mode="xpp3-reader" />
<modello-single-mode file="@{file}" version="@{version}" mode="xpp3-writer" />
</sequential>
</macrodef>
<macrodef name="modello-ex">
<attribute name="file" />
<attribute name="version" default="1.0.0" />
<sequential>
<modello file="@{file}" version="@{version}" />
<modello-single-mode file="@{file}" version="@{version}" mode="xpp3-extended-reader" />
</sequential>
</macrodef>
<modello-ex file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" />
<modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" />
<modello file="maven-model-builder/src/main/mdo/profiles.mdo" />
<modello file="maven-settings/src/main/mdo/settings.mdo" version="1.1.0" />
<modello file="maven-core/src/main/mdo/toolchains.mdo" version="1.1.0" />
<modello file="maven-repository-metadata/src/main/mdo/metadata.mdo" version="1.1.0" />
<modello file="maven-compat/src/main/mdo/profiles.mdo" />
<modello file="maven-compat/src/main/mdo/paramdoc.mdo" />
<modello file="maven-embedder/src/main/mdo/core-extensions.mdo" />
</target>
<target name="compile-boot" depends="generate-sources" description="compiles the bootstrap sources">
<path id="sources">
<dirset dir=".">
<include name="bootstrap/target/generated-sources" />
<include name="*/src/main/java" />
</dirset>
</path>
<mkdir dir="bootstrap/target/classes" />
<javac destdir="bootstrap/target/classes" encoding="UTF-8" source="1.7" target="1.7" debug="true" includeAntRuntime="false">
<src refid="sources" />
<classpath refid="pom.pathid" />
</javac>
<copy todir="bootstrap/target/classes" encoding="ISO-8859-1">
<fileset dir="maven-core/src/main/resources">
<include name="**/build.properties" />
</fileset>
<filterset begintoken="${" endtoken="}">
<filter token="project.version" value="${xmlPom.project.version}"/>
</filterset>
</copy>
<echo file="bootstrap/target/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties" encoding="ISO-8859-1">
version = ${xmlPom.project.version}
</echo>
<path id="maven.classpath">
<pathelement location="bootstrap/target/classes" />
<dirset dir=".">
<include name="*/src/main/resources" />
</dirset>
<path refid="pom.pathid" />
</path>
</target>
<target name="maven-compile" depends="compile-boot,process-classes" description="compiles Maven using the bootstrap Maven, skipping automated tests">
<java fork="${maven-compile.fork}" classname="org.apache.maven.cli.MavenCli" failonerror="true" timeout="600000" maxmemory="${maven-compile.maxmemory}">
<!--jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/-->
<!--jvmarg value="${maven-compile.jvmargs}"/-->
<classpath refid="maven.classpath" />
<arg value="${maven.debug}" />
<arg value="-B" />
<arg value="-V" />
<arg value="clean" />
<arg value="${maven.goal}" />
<arg value="-Dmaven.test.skip=${maven.test.skip}" />
<arg value="-DskipTests=${skipTests}" />
<arg value="-Dmaven.repo.local=${maven.repo.local}" />
<arg value="-Dsurefire.useFile=${surefire.useFile}" />
<arg value="-Dmaven.test.redirectTestOutputToFile=${maven.test.redirectTestOutputToFile}" />
<arg value="-DdistributionId=${distributionId}" />
<arg value="-DdistributionShortName=${distributionShortName}" />
<arg value="-DdistributionName=${distributionName}" />
<jvmarg value="-Dmaven.multiModuleProjectDirectory=${basedir}" />
</java>
</target>
<target name="maven-assembly" depends="maven-compile" description="generates the Maven installation assembly using the bootstrap Maven">
<echo>
The new Maven distribution was created as part of the MAVEN-COMPILE step, above.
This goal just validates the presence of that distribution.
</echo>
<condition property="build.failed">
<not>
<available file="${maven.assembly}" />
</not>
</condition>
<fail if="build.failed" message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}" />
</target>
<target name="extract-assembly" depends="init,prompt-maven-home-exists,maven-assembly" description="extracts the maven assembly into maven.home">
<echo>Extracting assembly to ${maven.home} ...</echo>
<!-- If we are starting from scratch make sure the directory is created -->
<delete dir="${maven.home}" />
<mkdir dir="${maven.home}" />
<unzip src="${maven.assembly}" dest="${maven.home}">
<mapper type="regexp" from="^[^\\/]+[\\/](.*)$$" to="\1" />
</unzip>
<chmod perm="+x">
<fileset dir="${maven.home}/bin">
<include name="mvn" />
<include name="mvnDebug" />
<include name="mvnyjp" />
</fileset>
</chmod>
</target>
<target name="all" depends="clean-bootstrap,init,extract-assembly" />
</project>

Binary file not shown.