[MNG-6914] move apache-maven-wrapper to its own separate Maven module

This commit is contained in:
Hervé Boutemy 2021-10-10 23:35:06 +02:00 committed by Hervé Boutemy
parent b58d8b3a4f
commit ede86ab4b6
23 changed files with 165 additions and 72 deletions

View File

@ -46,6 +46,13 @@ jobs:
name: built-maven
path: apache-maven/target/
- name: Upload built Apache Maven Wrapper
uses: actions/upload-artifact@v2
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: built-apache-maven-wrapper
path: apache-maven-wrapper/target/
- name: Upload built Maven Wrapper
uses: actions/upload-artifact@v2
if: ${{ matrix.os == 'ubuntu-latest' }}
@ -116,6 +123,12 @@ jobs:
name: built-maven
path: built-maven/
- name: Download built Apache Maven Wrapper
uses: actions/download-artifact@v2
with:
name: built-apache-maven-wrapper
path: built-apache-maven-wrapper/
- name: Download built Maven Wrapper
uses: actions/download-artifact@v2
with:
@ -131,4 +144,4 @@ jobs:
- name: Running integration tests
shell: bash
run: mvn install -e -B -V -Prun-its,embedded -Dmaven.repo.local="$HOME/.m2/repository" -DmavenDistro="$GITHUB_WORKSPACE/built-maven/apache-maven-bin.zip" -DwrapperDistroDir="$GITHUB_WORKSPACE/built-maven/" -DmavenWrapper="$GITHUB_WORKSPACE/built-maven-wrapper/maven-wrapper.jar" -f maven-integration-testing/pom.xml
run: mvn install -e -B -V -Prun-its,embedded -Dmaven.repo.local="$HOME/.m2/repository" -DmavenDistro="$GITHUB_WORKSPACE/built-maven/apache-maven-bin.zip" -DwrapperDistroDir="$GITHUB_WORKSPACE/built-apache-maven-wrapper/" -DmavenWrapper="$GITHUB_WORKSPACE/built-maven-wrapper/maven-wrapper.jar" -f maven-integration-testing/pom.xml

6
Jenkinsfile vendored
View File

@ -63,7 +63,10 @@ node(jenkinsEnv.nodeSelection(osNode)) {
sh "mvn ${MAVEN_GOAL} -B -U -e -fae -V -Dmaven.test.failure.ignore=true -P versionlessMavenDist"
}
dir ('apache-maven/target') {
stash includes: 'apache-maven-bin.zip,apache-maven-wrapper-*.zip', name: 'maven-dist'
stash includes: 'apache-maven-bin.zip', name: 'maven-dist'
}
dir ('apache-maven-wrapper/target') {
stash includes: 'apache-maven-wrapper-*.zip', name: 'maven-wrapper-dist'
}
dir ('maven-wrapper/target') {
stash includes: 'maven-wrapper.jar', name: 'wrapper-dist'
@ -102,6 +105,7 @@ for (String os in runITsOses) {
}
dir('dists') {
unstash 'maven-dist'
unstash 'maven-wrapper-dist'
unstash 'wrapper-dist'
}
try {

View File

@ -41,7 +41,7 @@ pipeline {
git url: "https://github.com/apache/maven-integration-testing.git", branch: "${ITS_BRANCH}"
sh "ls -lrt ${env.WORKSPACE}/apache-maven/target/"
withEnv(["JAVA_HOME=${ tool "JDK 1.8 (latest)" }", "PATH+MAVEN=${tool 'Maven 3.6.3'}/bin:${env.JAVA_HOME}/bin"]) {
sh "mvn clean install -V -B -Prun-its,embedded -Dmaven.test.failure.ignore=true -Dmaven.repo.local=${env.WORKSPACE}/repo -DmavenDistro=${env.WORKSPACE}/apache-maven/target/apache-maven-bin.zip -DwrapperDistroDir=${env.WORKSPACE}/apache-maven/target -DmavenWrapper=${env.WORKSPACE}/maven-wrapper/target/maven-wrapper.jar"
sh "mvn clean install -V -B -Prun-its,embedded -Dmaven.test.failure.ignore=true -Dmaven.repo.local=${env.WORKSPACE}/repo -DmavenDistro=${env.WORKSPACE}/apache-maven/target/apache-maven-bin.zip -DwrapperDistroDir=${env.WORKSPACE}/apache-maven-wrapper/target -DmavenWrapper=${env.WORKSPACE}/maven-wrapper/target/maven-wrapper.jar"
}
}
}

View File

@ -31,7 +31,7 @@ under the License.
<packaging>pom</packaging>
<name>Apache Maven Wrapper Distribution</name>
<description>The Apache Maven Wrapper distribution in zip and tar.gz formats.</description>
<description>The Apache Maven Wrapper distribution zips in 3 types: script, bin and source.</description>
<build>
<pluginManagement>
@ -42,19 +42,11 @@ under the License.
<configuration>
<excludes combine.children="append">
<exclude>src/assembly/maven/bin/m2.conf</exclude>
<!-- these are partial scripts, resulting in mvn/mwnw scripts -->
<exclude>src/assembly/shared/init</exclude>
<exclude>src/assembly/shared/init.cmd</exclude>
<exclude>src/assembly/shared/mvnlauncher</exclude>
<exclude>src/assembly/shared/mvnlauncher.cmd</exclude>
<exclude>src/assembly/shared/mvnvalidate</exclude>
<exclude>src/assembly/shared/mvnvalidate.cmd</exclude>
<exclude>src/assembly/shared/run</exclude>
<exclude>src/assembly/shared/run.cmd</exclude>
<exclude>src/assembly/wrapper/shared/mvnwlauncher</exclude>
<exclude>src/assembly/wrapper/shared/mvnwlauncher.cmd</exclude>
<exclude>src/assembly/wrapper/*/download</exclude>
<exclude>src/assembly/wrapper/*/download.cmd</exclude>
<!-- these are partial scripts, resulting in mwnw scripts -->
<exclude>src/assembly/shared/mvnwlauncher</exclude>
<exclude>src/assembly/shared/mvnwlauncher.cmd</exclude>
<exclude>src/assembly/*/download</exclude>
<exclude>src/assembly/*/download.cmd</exclude>
</excludes>
</configuration>
</plugin>
@ -81,9 +73,9 @@ under the License.
</executions>
<configuration>
<descriptors>
<descriptor>src/assembly/wrapper/script.xml</descriptor>
<descriptor>src/assembly/wrapper/bin.xml</descriptor>
<descriptor>src/assembly/wrapper/source.xml</descriptor>
<descriptor>src/assembly/script.xml</descriptor>
<descriptor>src/assembly/bin.xml</descriptor>
<descriptor>src/assembly/source.xml</descriptor>
</descriptors>
</configuration>
</plugin>
@ -103,7 +95,7 @@ under the License.
<id>apache-release</id>
<build>
<plugins>
<!-- calculate checksums of source release for Apache dist area -->
<!-- calculate sha512 checksums -->
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
@ -121,11 +113,8 @@ under the License.
<directory>${project.build.directory}</directory>
<includes>
<include>${project.artifactId}-${project.version}-bin.zip</include>
<include>${project.artifactId}-${project.version}-bin.tar.gz</include>
<include>${project.artifactId}-${project.version}-script.zip</include>
<include>${project.artifactId}-${project.version}-script.tar.gz</include>
<include>${project.artifactId}-${project.version}-source.zip</include>
<include>${project.artifactId}-${project.version}-source.tar.gz</include>
</includes>
</fileSet>
</fileSets>

View File

@ -39,22 +39,22 @@ under the License.
</dependencySets>
<files>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug.cmd</source>
<source>src/assembly/shared/mvnwDebug.cmd</source>
<outputDirectory>.</outputDirectory>
<lineEnding>dos</lineEnding>
</file>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug</source>
<source>src/assembly/shared/mvnwDebug</source>
<outputDirectory>.</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</file>
<file>
<sources>
<source>src/assembly/shared/validate.cmd</source>
<source>src/assembly/shared/init.cmd</source>
<source>src/assembly/wrapper/shared/mvnwlauncher.cmd</source>
<source>src/assembly/shared/run.cmd</source>
<source>../apache-maven/src/assembly/shared/validate.cmd</source>
<source>../apache-maven/src/assembly/shared/init.cmd</source>
<source>src/assembly/shared/mvnwlauncher.cmd</source>
<source>../apache-maven/src/assembly/shared/run.cmd</source>
</sources>
<destName>mvnw.cmd</destName>
<outputDirectory>.</outputDirectory>
@ -63,10 +63,10 @@ under the License.
</file>
<file>
<sources>
<source>src/assembly/shared/validate</source>
<source>src/assembly/shared/init</source>
<source>src/assembly/wrapper/shared/mvnwlauncher</source>
<source>src/assembly/shared/run</source>
<source>../apache-maven/src/assembly/shared/validate</source>
<source>../apache-maven/src/assembly/shared/init</source>
<source>src/assembly/shared/mvnwlauncher</source>
<source>../apache-maven/src/assembly/shared/run</source>
</sources>
<destName>mvnw</destName>
<outputDirectory>.</outputDirectory>
@ -77,9 +77,9 @@ under the License.
</files>
<fileSets>
<fileSet>
<directory>src/assembly/wrapper/shared/mvn</directory>
<directory>src/assembly/shared/mvn</directory>
<outputDirectory>.mvn</outputDirectory>
<filtered>true</filtered>
</fileSet>
</fileSets>
</assembly>
</assembly>

View File

@ -29,23 +29,23 @@ under the License.
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug.cmd</source>
<source>src/assembly/shared/mvnwDebug.cmd</source>
<outputDirectory>.</outputDirectory>
<lineEnding>dos</lineEnding>
</file>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug</source>
<source>src/assembly/shared/mvnwDebug</source>
<outputDirectory>.</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</file>
<file>
<sources>
<source>src/assembly/shared/validate.cmd</source>
<source>src/assembly/shared/init.cmd</source>
<source>src/assembly/wrapper/shared/mvnwlauncher.cmd</source>
<source>src/assembly/wrapper/script/download.cmd</source>
<source>src/assembly/shared/run.cmd</source>
<source>../apache-maven/src/assembly/shared/validate.cmd</source>
<source>../apache-maven/src/assembly/shared/init.cmd</source>
<source>src/assembly/shared/mvnwlauncher.cmd</source>
<source>src/assembly/script/download.cmd</source>
<source>../apache-maven/src/assembly/shared/run.cmd</source>
</sources>
<destName>mvnw.cmd</destName>
<outputDirectory>.</outputDirectory>
@ -54,11 +54,11 @@ under the License.
</file>
<file>
<sources>
<source>src/assembly/shared/validate</source>
<source>src/assembly/shared/init</source>
<source>src/assembly/wrapper/shared/mvnwlauncher</source>
<source>src/assembly/wrapper/script/download</source>
<source>src/assembly/shared/run</source>
<source>../apache-maven/src/assembly/shared/validate</source>
<source>../apache-maven/src/assembly/shared/init</source>
<source>src/assembly/shared/mvnwlauncher</source>
<source>src/assembly/script/download</source>
<source>../apache-maven/src/assembly/shared/run</source>
</sources>
<destName>mvnw</destName>
<outputDirectory>.</outputDirectory>
@ -69,9 +69,9 @@ under the License.
</files>
<fileSets>
<fileSet>
<directory>src/assembly/wrapper/shared/mvn</directory>
<directory>src/assembly/shared/mvn</directory>
<outputDirectory>.mvn</outputDirectory>
<filtered>true</filtered>
</fileSet>
</fileSets>
</assembly>
</assembly>

View File

@ -29,23 +29,23 @@ under the License.
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug.cmd</source>
<source>src/assembly/shared/mvnwDebug.cmd</source>
<outputDirectory>.</outputDirectory>
<lineEnding>dos</lineEnding>
</file>
<file>
<source>src/assembly/wrapper/shared/mvnwDebug</source>
<source>src/assembly/shared/mvnwDebug</source>
<outputDirectory>.</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</file>
<file>
<sources>
<source>src/assembly/shared/validate.cmd</source>
<source>src/assembly/shared/init.cmd</source>
<source>src/assembly/wrapper/shared/mvnwlauncher.cmd</source>
<source>src/assembly/wrapper/source/download.cmd</source>
<source>src/assembly/shared/run.cmd</source>
<source>../apache-maven/src/assembly/shared/validate.cmd</source>
<source>../apache-maven/src/assembly/shared/init.cmd</source>
<source>src/assembly/shared/mvnwlauncher.cmd</source>
<source>src/assembly/source/download.cmd</source>
<source>../apache-maven/src/assembly/shared/run.cmd</source>
</sources>
<destName>mvnw.cmd</destName>
<outputDirectory>.</outputDirectory>
@ -54,11 +54,11 @@ under the License.
</file>
<file>
<sources>
<source>src/assembly/shared/validate</source>
<source>src/assembly/shared/init</source>
<source>src/assembly/wrapper/shared/mvnwlauncher</source>
<source>src/assembly/wrapper/source/download</source>
<source>src/assembly/shared/run</source>
<source>../apache-maven/src/assembly/shared/validate</source>
<source>../apache-maven/src/assembly/shared/init</source>
<source>src/assembly/shared/mvnwlauncher</source>
<source>src/assembly/source/download</source>
<source>../apache-maven/src/assembly/shared/run</source>
</sources>
<destName>mvnw</destName>
<outputDirectory>.</outputDirectory>
@ -69,12 +69,12 @@ under the License.
</files>
<fileSets>
<fileSet>
<directory>src/assembly/wrapper/shared/mvn</directory>
<directory>src/assembly/shared/mvn</directory>
<outputDirectory>.mvn</outputDirectory>
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>src/assembly/wrapper/source/mvn</directory>
<directory>src/assembly/source/mvn</directory>
<outputDirectory>.mvn</outputDirectory>
<filtered>true</filtered>
</fileSet>

View File

@ -0,0 +1,58 @@
~~ 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.
-----
${project.name}
-----
Hervé Boutemy
-----
2021-10-10
-----
${project.name}
${project.description}
Distributions types share the same base structure:
----
mvnw
mvnw.cmd
mvnwDebug
mvnwDebug.cmd
.mvn/wrapper/maven-wrapper.properties
----
but every distribution has specific <<<mvnw>>>/<<<mvnw.cmd>>> scripts to manage different strategies to get {{{../maven-wrapper/}<<<maven-wrapper.jar>>>}}:
- <<<script>>> (default): <<<mvnw>>>/<<<mvnw.cmd>>> scripts will download {{{../maven-wrapper/}<<<maven-wrapper.jar>>>}} with <<<wget>>> or <<<curl>>> on Unix or PowerShell on Windows
- <<<bin>>>: no need to download <<<maven-wrapper.jar>>> binary, it is directly provided and used from project source tree:
----
.mvn/wrapper/maven-wrapper.jar
----
- <<<source>>>: <<<mvnw>>>/<<<mvnw.cmd>>> scripts will compile <<<MavenWrapperDownloader.java>>> source then run the class to download {{{../maven-wrapper/}<<<maven-wrapper.jar>>>}}:
----
.mvn/wrapper/MavenWrapperDownloader.java
----
[]
Distribution can be installed in a project either by unpacking zip archive by hand, or by using {{{/plugins/maven-wrapper-plugin/}<<<wrapper:wrapper>>>}}.

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd">
<edit>${project.scm.url}</edit>
<body>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>

View File

@ -125,7 +125,7 @@ under the License.
<configuration>
<excludes combine.children="append">
<exclude>src/assembly/maven/bin/m2.conf</exclude>
<!-- these are partial scripts, resulting in mvn/mwnw scripts -->
<!-- these are partial scripts, resulting in mvn scripts -->
<exclude>src/assembly/shared/init</exclude>
<exclude>src/assembly/shared/init.cmd</exclude>
<exclude>src/assembly/shared/mvnlauncher</exclude>
@ -134,10 +134,6 @@ under the License.
<exclude>src/assembly/shared/mvnvalidate.cmd</exclude>
<exclude>src/assembly/shared/run</exclude>
<exclude>src/assembly/shared/run.cmd</exclude>
<exclude>src/assembly/wrapper/shared/mvnwlauncher</exclude>
<exclude>src/assembly/wrapper/shared/mvnwlauncher.cmd</exclude>
<exclude>src/assembly/wrapper/*/download</exclude>
<exclude>src/assembly/wrapper/*/download.cmd</exclude>
</excludes>
</configuration>
</plugin>

View File

@ -25,4 +25,6 @@
Maven Wrapper
Maven Wrapper...
Maven Wrapper dowloads Maven distribution if not already in cache, then launches Maven.
It is called by {{{../apache-maven-wrapper/}<<<mvnw>>>/<<<mvnw.cmd>>> scripts}} that need to be installed in the project and called instead of <<<mvn>>>/<<<mvn.cmd>>>.

View File

@ -97,7 +97,7 @@ under the License.
<module>maven-compat</module>
<module>apache-maven</module> <!-- rename to apache-maven/maven.pom after RAT-268 -->
<module>maven-wrapper</module>
<module>apache-maven/maven-wrapper.pom</module>
<module>apache-maven-wrapper</module>
<module>maven-toolchain-model</module>
<module>maven-toolchain-builder</module>
</modules>

View File

@ -42,7 +42,7 @@ under the License.
<p>
<img src="images/maven-deps.png" width="1046" height="784" border="0" usemap="#Maven_dependencies" />
<map name="Maven_dependencies">
<area shape="rect" coords="433,1,658,41" alt="apache-maven-wrapper" href="apache-maven/" />
<area shape="rect" coords="433,1,658,41" alt="apache-maven-wrapper" href="apache-maven-wrapper/" />
<area shape="rect" coords="711,0,959,40" alt="maven-wrapper-plugin" href="/plugins/maven-wrapper-plugin/" />
<area shape="rect" coords="488,67,604,107" alt="maven-wrapper" href="maven-wrapper/" />
<area shape="rect" coords="378,132,467,172" alt="maven-bom" href="maven-bom/" />