From ede86ab4b6711b2f2971220f05c60bcf2f59655e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sun, 10 Oct 2021 23:35:06 +0200 Subject: [PATCH] [MNG-6914] move apache-maven-wrapper to its own separate Maven module --- .github/workflows/maven.yml | 15 ++++- Jenkinsfile | 6 +- Jenkinsfile.its | 2 +- .../pom.xml | 31 ++++------ .../src/assembly}/bin.xml | 24 ++++---- .../src/assembly}/script.xml | 28 ++++----- .../src/assembly}/script/download | 0 .../src/assembly}/script/download.cmd | 0 .../mvn/wrapper/maven-wrapper.properties | 0 .../src/assembly}/shared/mvnwDebug | 0 .../src/assembly}/shared/mvnwDebug.cmd | 0 .../src/assembly}/shared/mvnwlauncher | 0 .../src/assembly}/shared/mvnwlauncher.cmd | 0 .../src/assembly}/source.xml | 28 ++++----- .../src/assembly}/source/download | 0 .../src/assembly}/source/download.cmd | 0 .../mvn/wrapper/MavenWrapperDownloader.java | 0 .../src/site/apt/index.apt.vm | 58 +++++++++++++++++++ apache-maven-wrapper/src/site/site.xml | 31 ++++++++++ apache-maven/pom.xml | 6 +- maven-wrapper/src/site/apt/index.apt | 4 +- pom.xml | 2 +- src/site/xdoc/index.xml | 2 +- 23 files changed, 165 insertions(+), 72 deletions(-) rename apache-maven/maven-wrapper.pom => apache-maven-wrapper/pom.xml (71%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/bin.xml (76%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/script.xml (70%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/script/download (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/script/download.cmd (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/shared/mvn/wrapper/maven-wrapper.properties (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/shared/mvnwDebug (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/shared/mvnwDebug.cmd (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/shared/mvnwlauncher (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/shared/mvnwlauncher.cmd (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/source.xml (71%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/source/download (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/source/download.cmd (100%) rename {apache-maven/src/assembly/wrapper => apache-maven-wrapper/src/assembly}/source/mvn/wrapper/MavenWrapperDownloader.java (100%) create mode 100644 apache-maven-wrapper/src/site/apt/index.apt.vm create mode 100644 apache-maven-wrapper/src/site/site.xml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 733d929dc6..addba89d63 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile index 54b8652e04..15947ed228 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 { diff --git a/Jenkinsfile.its b/Jenkinsfile.its index 5df3e2cb6d..825861363c 100644 --- a/Jenkinsfile.its +++ b/Jenkinsfile.its @@ -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" } } } diff --git a/apache-maven/maven-wrapper.pom b/apache-maven-wrapper/pom.xml similarity index 71% rename from apache-maven/maven-wrapper.pom rename to apache-maven-wrapper/pom.xml index 482cddd4cd..eec5c7ce3a 100644 --- a/apache-maven/maven-wrapper.pom +++ b/apache-maven-wrapper/pom.xml @@ -31,7 +31,7 @@ under the License. pom Apache Maven Wrapper Distribution - The Apache Maven Wrapper distribution in zip and tar.gz formats. + The Apache Maven Wrapper distribution zips in 3 types: script, bin and source. @@ -42,19 +42,11 @@ under the License. src/assembly/maven/bin/m2.conf - - src/assembly/shared/init - src/assembly/shared/init.cmd - src/assembly/shared/mvnlauncher - src/assembly/shared/mvnlauncher.cmd - src/assembly/shared/mvnvalidate - src/assembly/shared/mvnvalidate.cmd - src/assembly/shared/run - src/assembly/shared/run.cmd - src/assembly/wrapper/shared/mvnwlauncher - src/assembly/wrapper/shared/mvnwlauncher.cmd - src/assembly/wrapper/*/download - src/assembly/wrapper/*/download.cmd + + src/assembly/shared/mvnwlauncher + src/assembly/shared/mvnwlauncher.cmd + src/assembly/*/download + src/assembly/*/download.cmd @@ -81,9 +73,9 @@ under the License. - src/assembly/wrapper/script.xml - src/assembly/wrapper/bin.xml - src/assembly/wrapper/source.xml + src/assembly/script.xml + src/assembly/bin.xml + src/assembly/source.xml @@ -103,7 +95,7 @@ under the License. apache-release - + net.nicoulaj.maven.plugins checksum-maven-plugin @@ -121,11 +113,8 @@ under the License. ${project.build.directory} ${project.artifactId}-${project.version}-bin.zip - ${project.artifactId}-${project.version}-bin.tar.gz ${project.artifactId}-${project.version}-script.zip - ${project.artifactId}-${project.version}-script.tar.gz ${project.artifactId}-${project.version}-source.zip - ${project.artifactId}-${project.version}-source.tar.gz diff --git a/apache-maven/src/assembly/wrapper/bin.xml b/apache-maven-wrapper/src/assembly/bin.xml similarity index 76% rename from apache-maven/src/assembly/wrapper/bin.xml rename to apache-maven-wrapper/src/assembly/bin.xml index 7321631438..76cdc180c0 100644 --- a/apache-maven/src/assembly/wrapper/bin.xml +++ b/apache-maven-wrapper/src/assembly/bin.xml @@ -39,22 +39,22 @@ under the License. - src/assembly/wrapper/shared/mvnwDebug.cmd + src/assembly/shared/mvnwDebug.cmd . dos - src/assembly/wrapper/shared/mvnwDebug + src/assembly/shared/mvnwDebug . unix 0755 - src/assembly/shared/validate.cmd - src/assembly/shared/init.cmd - src/assembly/wrapper/shared/mvnwlauncher.cmd - src/assembly/shared/run.cmd + ../apache-maven/src/assembly/shared/validate.cmd + ../apache-maven/src/assembly/shared/init.cmd + src/assembly/shared/mvnwlauncher.cmd + ../apache-maven/src/assembly/shared/run.cmd mvnw.cmd . @@ -63,10 +63,10 @@ under the License. - src/assembly/shared/validate - src/assembly/shared/init - src/assembly/wrapper/shared/mvnwlauncher - src/assembly/shared/run + ../apache-maven/src/assembly/shared/validate + ../apache-maven/src/assembly/shared/init + src/assembly/shared/mvnwlauncher + ../apache-maven/src/assembly/shared/run mvnw . @@ -77,9 +77,9 @@ under the License. - src/assembly/wrapper/shared/mvn + src/assembly/shared/mvn .mvn true - \ No newline at end of file + diff --git a/apache-maven/src/assembly/wrapper/script.xml b/apache-maven-wrapper/src/assembly/script.xml similarity index 70% rename from apache-maven/src/assembly/wrapper/script.xml rename to apache-maven-wrapper/src/assembly/script.xml index 8d4d750635..8f5406e426 100644 --- a/apache-maven/src/assembly/wrapper/script.xml +++ b/apache-maven-wrapper/src/assembly/script.xml @@ -29,23 +29,23 @@ under the License. false - src/assembly/wrapper/shared/mvnwDebug.cmd + src/assembly/shared/mvnwDebug.cmd . dos - src/assembly/wrapper/shared/mvnwDebug + src/assembly/shared/mvnwDebug . unix 0755 - src/assembly/shared/validate.cmd - src/assembly/shared/init.cmd - src/assembly/wrapper/shared/mvnwlauncher.cmd - src/assembly/wrapper/script/download.cmd - src/assembly/shared/run.cmd + ../apache-maven/src/assembly/shared/validate.cmd + ../apache-maven/src/assembly/shared/init.cmd + src/assembly/shared/mvnwlauncher.cmd + src/assembly/script/download.cmd + ../apache-maven/src/assembly/shared/run.cmd mvnw.cmd . @@ -54,11 +54,11 @@ under the License. - src/assembly/shared/validate - src/assembly/shared/init - src/assembly/wrapper/shared/mvnwlauncher - src/assembly/wrapper/script/download - src/assembly/shared/run + ../apache-maven/src/assembly/shared/validate + ../apache-maven/src/assembly/shared/init + src/assembly/shared/mvnwlauncher + src/assembly/script/download + ../apache-maven/src/assembly/shared/run mvnw . @@ -69,9 +69,9 @@ under the License. - src/assembly/wrapper/shared/mvn + src/assembly/shared/mvn .mvn true - \ No newline at end of file + diff --git a/apache-maven/src/assembly/wrapper/script/download b/apache-maven-wrapper/src/assembly/script/download similarity index 100% rename from apache-maven/src/assembly/wrapper/script/download rename to apache-maven-wrapper/src/assembly/script/download diff --git a/apache-maven/src/assembly/wrapper/script/download.cmd b/apache-maven-wrapper/src/assembly/script/download.cmd similarity index 100% rename from apache-maven/src/assembly/wrapper/script/download.cmd rename to apache-maven-wrapper/src/assembly/script/download.cmd diff --git a/apache-maven/src/assembly/wrapper/shared/mvn/wrapper/maven-wrapper.properties b/apache-maven-wrapper/src/assembly/shared/mvn/wrapper/maven-wrapper.properties similarity index 100% rename from apache-maven/src/assembly/wrapper/shared/mvn/wrapper/maven-wrapper.properties rename to apache-maven-wrapper/src/assembly/shared/mvn/wrapper/maven-wrapper.properties diff --git a/apache-maven/src/assembly/wrapper/shared/mvnwDebug b/apache-maven-wrapper/src/assembly/shared/mvnwDebug similarity index 100% rename from apache-maven/src/assembly/wrapper/shared/mvnwDebug rename to apache-maven-wrapper/src/assembly/shared/mvnwDebug diff --git a/apache-maven/src/assembly/wrapper/shared/mvnwDebug.cmd b/apache-maven-wrapper/src/assembly/shared/mvnwDebug.cmd similarity index 100% rename from apache-maven/src/assembly/wrapper/shared/mvnwDebug.cmd rename to apache-maven-wrapper/src/assembly/shared/mvnwDebug.cmd diff --git a/apache-maven/src/assembly/wrapper/shared/mvnwlauncher b/apache-maven-wrapper/src/assembly/shared/mvnwlauncher similarity index 100% rename from apache-maven/src/assembly/wrapper/shared/mvnwlauncher rename to apache-maven-wrapper/src/assembly/shared/mvnwlauncher diff --git a/apache-maven/src/assembly/wrapper/shared/mvnwlauncher.cmd b/apache-maven-wrapper/src/assembly/shared/mvnwlauncher.cmd similarity index 100% rename from apache-maven/src/assembly/wrapper/shared/mvnwlauncher.cmd rename to apache-maven-wrapper/src/assembly/shared/mvnwlauncher.cmd diff --git a/apache-maven/src/assembly/wrapper/source.xml b/apache-maven-wrapper/src/assembly/source.xml similarity index 71% rename from apache-maven/src/assembly/wrapper/source.xml rename to apache-maven-wrapper/src/assembly/source.xml index 29c4564ff8..1e7e667502 100644 --- a/apache-maven/src/assembly/wrapper/source.xml +++ b/apache-maven-wrapper/src/assembly/source.xml @@ -29,23 +29,23 @@ under the License. false - src/assembly/wrapper/shared/mvnwDebug.cmd + src/assembly/shared/mvnwDebug.cmd . dos - src/assembly/wrapper/shared/mvnwDebug + src/assembly/shared/mvnwDebug . unix 0755 - src/assembly/shared/validate.cmd - src/assembly/shared/init.cmd - src/assembly/wrapper/shared/mvnwlauncher.cmd - src/assembly/wrapper/source/download.cmd - src/assembly/shared/run.cmd + ../apache-maven/src/assembly/shared/validate.cmd + ../apache-maven/src/assembly/shared/init.cmd + src/assembly/shared/mvnwlauncher.cmd + src/assembly/source/download.cmd + ../apache-maven/src/assembly/shared/run.cmd mvnw.cmd . @@ -54,11 +54,11 @@ under the License. - src/assembly/shared/validate - src/assembly/shared/init - src/assembly/wrapper/shared/mvnwlauncher - src/assembly/wrapper/source/download - src/assembly/shared/run + ../apache-maven/src/assembly/shared/validate + ../apache-maven/src/assembly/shared/init + src/assembly/shared/mvnwlauncher + src/assembly/source/download + ../apache-maven/src/assembly/shared/run mvnw . @@ -69,12 +69,12 @@ under the License. - src/assembly/wrapper/shared/mvn + src/assembly/shared/mvn .mvn true - src/assembly/wrapper/source/mvn + src/assembly/source/mvn .mvn true diff --git a/apache-maven/src/assembly/wrapper/source/download b/apache-maven-wrapper/src/assembly/source/download similarity index 100% rename from apache-maven/src/assembly/wrapper/source/download rename to apache-maven-wrapper/src/assembly/source/download diff --git a/apache-maven/src/assembly/wrapper/source/download.cmd b/apache-maven-wrapper/src/assembly/source/download.cmd similarity index 100% rename from apache-maven/src/assembly/wrapper/source/download.cmd rename to apache-maven-wrapper/src/assembly/source/download.cmd diff --git a/apache-maven/src/assembly/wrapper/source/mvn/wrapper/MavenWrapperDownloader.java b/apache-maven-wrapper/src/assembly/source/mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from apache-maven/src/assembly/wrapper/source/mvn/wrapper/MavenWrapperDownloader.java rename to apache-maven-wrapper/src/assembly/source/mvn/wrapper/MavenWrapperDownloader.java diff --git a/apache-maven-wrapper/src/site/apt/index.apt.vm b/apache-maven-wrapper/src/site/apt/index.apt.vm new file mode 100644 index 0000000000..a8ecdc9e8c --- /dev/null +++ b/apache-maven-wrapper/src/site/apt/index.apt.vm @@ -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 <<>>/<<>> scripts to manage different strategies to get {{{../maven-wrapper/}<<>>}}: + + - <<