Integrate into maven's build

This commit is contained in:
Guillaume Nodet 2024-10-27 23:54:49 +01:00
parent 4270e7883f
commit 75258afcc6
22 changed files with 326 additions and 447 deletions

2
.gitattributes vendored
View File

@ -6,3 +6,5 @@
*.css text *.css text
*.js text *.js text
*.sql text *.sql text
*.jar binary
*.war binary

View File

@ -17,128 +17,170 @@
name: Java CI name: Java CI
on: [push, pull_request, workflow_dispatch] on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# clear all permissions for GITHUB_TOKEN # clear all permissions for GITHUB_TOKEN
permissions: {} permissions: {}
jobs: jobs:
build: initial-build:
runs-on: ubuntu-latest
# execute on any push, workflow_dispatch or pull request from forked repo
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork )
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - name: Set up JDK
with: uses: actions/setup-java@v4
persist-credentials: false
- uses: actions/setup-java@v4
with: with:
java-version: 17 java-version: 17
distribution: 'temurin' distribution: 'temurin'
cache: 'maven'
- name: Set up Maven - name: Checkout maven
run:
mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=3.9.7"
- name: Build with Maven
run: ./mvnw verify -e -B -V -DdistributionFileName=apache-maven
- name: Upload built Maven
uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: built-maven
path: apache-maven/target/
integration-test:
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java: [17, 21]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Collect environment context variables
shell: bash
env:
PR_HEAD_LABEL: ${{ github.event.pull_request.head.label }}
run: |
set +e
repo=maven-integration-testing
target_branch=master
target_user=apache
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
user=${PR_HEAD_LABEL%:*}
branch=${PR_HEAD_LABEL#*:}
else
user=${GITHUB_REPOSITORY%/*}
branch=${GITHUB_REF#refs/heads/}
fi
if [ $branch != "master" ]; then
git ls-remote https://github.com/$user/$repo.git | grep "refs/heads/${branch}$" > /dev/null
if [ $? -eq 0 ]; then
echo "Found a branch \"$branch\" in fork \"$user/$repo\", configuring this for the integration tests to be run against."
target_branch=$branch
target_user=$user
else
echo "Could not find fork \"$user/$repo\" or a branch \"$branch\" in this fork. Falling back to \"$target_branch\" in \"$target_user/$repo\"."
fi
else
echo "Integration tests will run against $target_user/$repo for master builds."
fi
echo "REPO_BRANCH=$target_branch" >> $GITHUB_ENV
echo "REPO_USER=$target_user" >> $GITHUB_ENV
- name: Checkout maven-integration-testing
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: ${{ env.REPO_USER }}/maven-integration-testing
path: maven-integration-testing/
ref: ${{ env.REPO_BRANCH }}
persist-credentials: false persist-credentials: false
- name: Set up JDK - name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository/cached
key: maven-${{ hashFiles('**/pom.xml') }}
restore-keys: maven-
enableCrossOsArchive: true
- name: Set up Maven
shell: bash
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=4.0.0-beta-4"
- name: Build Maven distributions
shell: bash
run: ./mvnw verify -e -B -V -DdistributionFileName=apache-maven
- name: List contents of target directory
shell: bash
run: ls -la apache-maven/target
- name: Upload Maven distributions
uses: actions/upload-artifact@v4
with:
name: maven-distributions
path: |
apache-maven/target/apache-maven*.zip
apache-maven/target/apache-maven*.tar.gz
full-build:
needs: initial-build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java: ['17', '21']
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
distribution: 'temurin' distribution: 'temurin'
# cache: 'maven' - don't use cache for integration tests
- uses: actions/checkout@v4 - name: Install Graphviz (MacOS)
if: runner.os == 'macOS'
run: brew install graphviz
- name: Install Graphviz (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get install graphviz
- name: Install Graphviz (Windows)
if: runner.os == 'Windows'
run: choco install graphviz
- name: Checkout maven
uses: actions/checkout@v4
with: with:
path: maven/
persist-credentials: false persist-credentials: false
- name: Set up Maven - name: Download Maven distribution
run: uses: actions/download-artifact@v4
mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=3.9.7"
- name: Build Maven
run: ./mvnw install -e -B -V -DdistributionFileName=apache-maven -DskipTests -f maven/pom.xml
- name: Running integration tests
shell: bash
run: ./mvnw install -e -B -V -Prun-its,embedded -DmavenDistro="$GITHUB_WORKSPACE/maven/apache-maven/target/apache-maven-bin.zip" -f maven-integration-testing/pom.xml
- name: Upload artifact on integration testing
uses: actions/upload-artifact@v4
if: failure() && matrix.os != 'windows-latest'
with: with:
name: ${{ github.run_number }}-integration-test-artifact-${{ matrix.os }}-${{ matrix.java }} name: maven-distributions
path: ./maven-integration-testing/core-it-suite/target/test-classes/ path: maven-dist
- name: List downloaded files
shell: bash
run: ls -la maven-dist
- name: Extract Maven distribution
shell: bash
run: |
mkdir -p maven-local
if [ "${{ runner.os }}" = "Windows" ]; then
unzip maven-dist/apache-maven-bin.zip -d maven-local
else
tar xzf maven-dist/apache-maven-bin.tar.gz -C maven-local --strip-components 1
fi
echo "MAVEN_HOME=$PWD/maven-local" >> $GITHUB_ENV
echo "$PWD/maven-local/bin" >> $GITHUB_PATH
- name: Build site with downloaded Maven
shell: bash
run: mvn verify site -e -B -V -DdistributionFileName=apache-maven -Preporting
integration-tests:
needs: initial-build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java: ['17', '21']
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Checkout maven
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Download Maven distribution
uses: actions/download-artifact@v4
with:
name: maven-distributions
path: maven-dist
- name: List downloaded files
shell: bash
run: ls -la maven-dist
- name: Extract Maven distribution
shell: bash
run: |
mkdir -p maven-local
if [ "${{ runner.os }}" = "Windows" ]; then
unzip maven-dist/apache-maven-bin.zip -d maven-local
# Get the name of the extracted directory
MAVEN_DIR=$(ls maven-local)
# Move contents up one level
mv "maven-local/$MAVEN_DIR"/* maven-local/
rm -r "maven-local/$MAVEN_DIR"
else
tar xzf maven-dist/apache-maven-bin.tar.gz -C maven-local --strip-components 1
fi
echo "MAVEN_HOME=$PWD/maven-local" >> $GITHUB_ENV
echo "$PWD/maven-local/bin" >> $GITHUB_PATH
- name: Run integration tests
shell: bash
run: mvn install -e -B -V -Prun-its,embedded
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ github.run_number }}-integration-test-artifact-${{ runner.os }}-${{ matrix.java }}
path: ./its/core-it-suite/target/test-classes/

View File

@ -1,87 +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.
name: Can Maven build itself
on: [push, pull_request]
# clear all permissions for GITHUB_TOKEN
permissions: {}
jobs:
build:
# execute on any push or pull request from forked repo
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork )
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
java: [17, 21]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Set up Maven
run:
mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.3.2:wrapper "-Dmaven=3.9.7"
- name: Build with Maven
run: ./mvnw install -e -B -V -DdistributionFileName=apache-maven
- name: Extract tarball
shell: bash
run: |
set +e
if [ -f ${{ env.TAR_BALL }} ]; then
temp_dir=$(mktemp -d)
tar -xzf ${{ env.TAR_BALL }} -C "$temp_dir" --strip 1
maven_bin_dir=$temp_dir/bin
if [ -d $maven_bin_dir ]; then
echo "tar.gz file \"${{ env.TAR_BALL }}\" successfully extracted in temporarily directory \"$temp_dir.\""
echo "TEMP_MAVEN_BIN_DIR=$maven_bin_dir" >> $GITHUB_ENV
else
echo "$maven_bin_dir does not exist."
exit 1;
fi
else
echo "${{ env.TAR_BALL }} does not exist."
exit 1;
fi
env:
TAR_BALL: apache-maven/target/apache-maven-bin.tar.gz
- name: Clean with Maven
run: ./mvnw -e -B -V clean
- name: Build again with Maven SNAPSHOT
shell: bash
run: |
set +e
export PATH=${{ env.TEMP_MAVEN_BIN_DIR }}:$PATH
mvn verify site -e -B -V -DdistributionFileName=apache-maven -Preporting

View File

@ -353,6 +353,34 @@ under the License.
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>run-its</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-distribution-dir</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>./</finalName>
<appendAssemblyId>false</appendAssemblyId>
<attach>false</attach>
<outputDirectory>${basedir}/target/maven</outputDirectory>
<descriptors>
<descriptor>src/assembly/dir.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>apache-release</id> <id>apache-release</id>
<build> <build>

View File

@ -1,3 +1,22 @@
#
# 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.
#
# #
# Maven user properties # Maven user properties
# #

View File

@ -1,12 +0,0 @@
# see https://s.apache.org/asfyaml
github:
description: "Apache Maven core ITs"
homepage: https://maven.apache.org/core-its
labels:
- java
- build-management
- maven
enabled_merge_buttons:
squash: true
merge: false
rebase: true

4
its/.gitattributes vendored
View File

@ -1,4 +0,0 @@
# Auto detect text files and perform LF normalization
*.jar binary
*.war binary

View File

@ -1,29 +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.
#
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View File

@ -1,55 +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.
name: Java CI
on: [push, pull_request]
# clear all permissions for GITHUB_TOKEN
permissions: {}
jobs:
build:
# execute on any push or pull request from forked repo
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork )
strategy:
matrix:
os: [ubuntu-latest]
java: [11, 17, 21]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Set up Maven
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dtype=only-script" "-Dmaven=3.9.7"
- name: Running integration tests
run: "./mvnw -B clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo"

View File

@ -1 +0,0 @@
.mvn directory should exist in project root

64
its/Jenkinsfile vendored
View File

@ -1,64 +0,0 @@
#!groovy
pipeline {
agent any
// save some io during the build
options { durabilityHint('PERFORMANCE_OPTIMIZED') }
stages {
stage("Parallel Stage") {
parallel {
stage("Build / Test - mvn latest - JDK8 - ubuntu") {
agent { node { label 'ubuntu' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
mavenBuild( "jdk_1.8_latest", "maven_latest")
}
}
}
stage("Build / Test - mvn latest - JDK11 - ubuntu") {
agent { node { label 'ubuntu' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
mavenBuild( "jdk_11_latest", "maven_latest")
}
}
}
stage("Build / Test - mvn latest - JDK8 - windowx") {
agent { node { label 'Windows' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
mavenBuild( "jdk_1.8_latest", "maven_latest")
}
}
}
stage("Build / Test - mvn latest - JDK11 - windows") {
agent { node { label 'Windows' } }
steps {
timeout( time: 180, unit: 'MINUTES' ) {
mavenBuild( "jdk_11_latest", "maven_latest")
}
}
}
}
}
}
}
def mavenBuild(jdk, mvnName) {
script {
try {
withMaven(jdk: "$jdk", maven: "$mvnName", publisherStrategy: 'EXPLICIT', mavenOpts: "-Xms2g -Xmx4g -Djava.awt.headless=true") {
if (isUnix()) {
sh "mvn -V clean install -Prun-its,embedded -B"
} else {
bat "mvn -V clean install -Prun-its,embedded -B"
}
}
}
finally
{
junit testResults: 'core-it-suite/target/surefire-reports/*.xml', allowEmptyResults: true
}
}
}

View File

@ -580,6 +580,13 @@ under the License.
<profile> <profile>
<id>run-its</id> <id>run-its</id>
<dependencies> <dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>apache-maven</artifactId>
<version>4.0.0-beta-6-SNAPSHOT</version>
<classifier>bin</classifier>
<type>zip</type>
</dependency>
<!-- not really used but will force download in the local repo used --> <!-- not really used but will force download in the local repo used -->
<dependency> <dependency>
<groupId>org.apache.maven.wagon</groupId> <groupId>org.apache.maven.wagon</groupId>

View File

@ -30,19 +30,27 @@ import org.junit.jupiter.api.Test;
public class MavenITmng8106OverlappingDirectoryRolesTest extends AbstractMavenIntegrationTestCase { public class MavenITmng8106OverlappingDirectoryRolesTest extends AbstractMavenIntegrationTestCase {
public MavenITmng8106OverlappingDirectoryRolesTest() { public MavenITmng8106OverlappingDirectoryRolesTest() {
// Broken in: 3.9.0..3.9.6 && 4.0.0-alpha-1..4.0.0-alpha-13 // Broken in: 3.9.0..3.9.6 && 4.0.0-alpha-1..4.0.0-alpha-13
super("[,3.9.0),(3.9.6,3.999.999],[4.0.0-beta-1,)"); super("(3.9.6,3.999.999],[4.0.0-beta-1,)");
} }
@Test @Test
public void testDirectoryOverlap() throws Exception { public void testDirectoryOverlap() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8106"); File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8106");
String repo = new File(testDir, "repo").getAbsolutePath();
String tailRepo = System.getProperty("user.home") + File.separator + ".m2" + File.separator + "repository";
Verifier verifier = newVerifier(new File(testDir, "plugin").getAbsolutePath()); Verifier verifier = newVerifier(new File(testDir, "plugin").getAbsolutePath());
verifier.setLocalRepo(repo);
verifier.addCliArgument("-X");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + tailRepo);
verifier.addCliArgument("install"); verifier.addCliArgument("install");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
verifier = newVerifier(new File(testDir, "jar").getAbsolutePath()); verifier = newVerifier(new File(testDir, "jar").getAbsolutePath());
verifier.setLocalRepo(repo);
verifier.addCliArgument("-X");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + tailRepo);
verifier.addCliArgument("install"); verifier.addCliArgument("install");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();

View File

@ -51,7 +51,6 @@ class MavenITmng8347TransitiveDependencyManagerTest extends AbstractMavenIntegra
verifier.addCliArgument("-V"); verifier.addCliArgument("-V");
verifier.addCliArgument("dependency:3.8.0:tree"); verifier.addCliArgument("dependency:3.8.0:tree");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo"); verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo");
verifier.addCliArgument("-Dmaven.repo.local.tail.ignoreAvailability");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
@ -98,7 +97,6 @@ class MavenITmng8347TransitiveDependencyManagerTest extends AbstractMavenIntegra
verifier.addCliArgument("-V"); verifier.addCliArgument("-V");
verifier.addCliArgument("dependency:3.8.0:tree"); verifier.addCliArgument("dependency:3.8.0:tree");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo"); verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo");
verifier.addCliArgument("-Dmaven.repo.local.tail.ignoreAvailability");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();
@ -125,7 +123,6 @@ class MavenITmng8347TransitiveDependencyManagerTest extends AbstractMavenIntegra
verifier.addCliArgument("-V"); verifier.addCliArgument("-V");
verifier.addCliArgument("dependency:3.8.0:tree"); verifier.addCliArgument("dependency:3.8.0:tree");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo"); verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo");
verifier.addCliArgument("-Dmaven.repo.local.tail.ignoreAvailability");
verifier.execute(); verifier.execute();
verifier.verifyErrorFreeLog(); verifier.verifyErrorFreeLog();

View File

@ -10,13 +10,13 @@ Facts:
Command to run: Command to run:
``` ```
mvn eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo -Dmaven.repo.local.tail.ignoreAvailability mvn eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo
``` ```
Example output with 3.9.9: Maven 3 is not transitive regarding dependency management, and it shows 1.0.0 all way down Example output with 3.9.9: Maven 3 is not transitive regarding dependency management, and it shows 1.0.0 all way down
except for level5 that has applies depMgt from root. except for level5 that has applies depMgt from root.
``` ```
$ mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo -Dmaven.repo.local.tail.ignoreAvailability $ mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /home/cstamas/.sdkman/candidates/maven/3.9.9 Maven home: /home/cstamas/.sdkman/candidates/maven/3.9.9
Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem
@ -49,7 +49,7 @@ $
Example output with 4.0.0-beta-5: **this version is transitive but broken**, as it applies level2 depMgt onto its own Example output with 4.0.0-beta-5: **this version is transitive but broken**, as it applies level2 depMgt onto its own
dependencies. dependencies.
``` ```
$ mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo -Dmaven.repo.local.tail.ignoreAvailability $ mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo
Apache Maven 4.0.0-beta-5 (6e78fcf6f5e76422c0eb358cd11f0c231ecafbad) Apache Maven 4.0.0-beta-5 (6e78fcf6f5e76422c0eb358cd11f0c231ecafbad)
Maven home: /home/cstamas/.sdkman/candidates/maven/4.0.0-beta-5 Maven home: /home/cstamas/.sdkman/candidates/maven/4.0.0-beta-5
Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem
@ -96,7 +96,7 @@ The **expected** output is:
Maven 4.0.0-SNAPSHOT + Resolver [2.0.3-SNAPSHOT](https://github.com/apache/maven-resolver/pull/588) output **is expected output**: Maven 4.0.0-SNAPSHOT + Resolver [2.0.3-SNAPSHOT](https://github.com/apache/maven-resolver/pull/588) output **is expected output**:
``` ```
$ ~/Tools/maven/apache-maven-4.0.0-beta-6-SNAPSHOT/bin/mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo -Dmaven.repo.local.tail.ignoreAvailability $ ~/Tools/maven/apache-maven-4.0.0-beta-6-SNAPSHOT/bin/mvn -V eu.maveniverse.maven.plugins:toolbox:tree -Dmaven.repo.local.tail=local-repo
Apache Maven 4.0.0-beta-6-SNAPSHOT (cf94fba0151ff403763bdf23eb73fe74b3d0874d) Apache Maven 4.0.0-beta-6-SNAPSHOT (cf94fba0151ff403763bdf23eb73fe74b3d0874d)
Maven home: /home/cstamas/Tools/maven/apache-maven-4.0.0-beta-6-SNAPSHOT Maven home: /home/cstamas/Tools/maven/apache-maven-4.0.0-beta-6-SNAPSHOT
Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.4-tem

View File

@ -104,6 +104,7 @@ class PropertiesUtil {
} else if (value instanceof Map) { } else if (value instanceof Map) {
Map map = (Map) value; Map map = (Map) value;
props.setProperty(key, Integer.toString(map.size())); props.setProperty(key, Integer.toString(map.size()));
@SuppressWarnings("checkstyle:UnusedLocalVariable")
int i = 0; int i = 0;
for (Iterator it = map.keySet().iterator(); it.hasNext(); i++) { for (Iterator it = map.keySet().iterator(); it.hasNext(); i++) {
Object k = it.next(); Object k = it.next();

View File

@ -87,6 +87,7 @@ class PropertyUtil {
} else if (obj instanceof Map) { } else if (obj instanceof Map) {
Map map = (Map) obj; Map map = (Map) obj;
props.put(key, Integer.toString(map.size())); props.put(key, Integer.toString(map.size()));
@SuppressWarnings("checkstyle:UnusedLocalVariable")
int index = 0; int index = 0;
for (Iterator it = map.entrySet().iterator(); it.hasNext(); index++) { for (Iterator it = map.entrySet().iterator(); it.hasNext(); index++) {
Map.Entry entry = (Map.Entry) it.next(); Map.Entry entry = (Map.Entry) it.next();

View File

@ -47,6 +47,7 @@ public class UsesWagonMojo extends AbstractMojo {
throw new MojoExecutionException(e.getMessage(), e); throw new MojoExecutionException(e.getMessage(), e);
} }
try { try {
@SuppressWarnings("checkstyle:UnusedLocalVariable")
FileWagon theWagon = (FileWagon) fileWagon; FileWagon theWagon = (FileWagon) fileWagon;
} catch (ClassCastException e) { } catch (ClassCastException e) {
getLog().error("", e); getLog().error("", e);
@ -64,6 +65,7 @@ public class UsesWagonMojo extends AbstractMojo {
throw new MojoExecutionException(e.getMessage(), e); throw new MojoExecutionException(e.getMessage(), e);
} }
try { try {
@SuppressWarnings("checkstyle:UnusedLocalVariable")
ScpWagon theWagon = (ScpWagon) scpWagon; ScpWagon theWagon = (ScpWagon) scpWagon;
} catch (ClassCastException e) { } catch (ClassCastException e) {
getLog().error("", e); getLog().error("", e);

View File

@ -32,14 +32,14 @@ under the License.
<name>Maven IT Plugin :: mng-7529 plugin</name> <name>Maven IT Plugin :: mng-7529 plugin</name>
<properties> <properties>
<maven-version>3.6.0</maven-version> <maven3-version>3.6.0</maven3-version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>${maven-version}</version> <version>${maven3-version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -50,13 +50,13 @@ under the License.
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId> <artifactId>maven-core</artifactId>
<version>${maven-version}</version> <version>${maven3-version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId> <artifactId>maven-model</artifactId>
<version>${maven-version}</version> <version>${maven3-version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -58,6 +58,7 @@ public class ResolveMojo extends AbstractMojo {
request.setMavenProject(project); request.setMavenProject(project);
request.setRepositorySession(buildingRequest.getRepositorySession()); request.setRepositorySession(buildingRequest.getRepositorySession());
@SuppressWarnings("checkstyle:UnusedLocalVariable")
DependencyResolutionResult result = dependencyResolver.resolve(request); DependencyResolutionResult result = dependencyResolver.resolve(request);
getLog().info("Resolution successful, resolved ok"); getLog().info("Resolution successful, resolved ok");

View File

@ -22,9 +22,8 @@ under the License.
<parent> <parent>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId> <artifactId>maven</artifactId>
<version>41</version> <version>4.0.0-beta-6-SNAPSHOT</version>
<relativePath />
</parent> </parent>
<groupId>org.apache.maven.its</groupId> <groupId>org.apache.maven.its</groupId>
@ -71,10 +70,10 @@ under the License.
<maven.site.path>core-its</maven.site.path> <maven.site.path>core-its</maven.site.path>
<maven.site.cache>${user.home}/maven-sites</maven.site.cache> <maven.site.cache>${user.home}/maven-sites</maven.site.cache>
<rat.ignoreErrors>true</rat.ignoreErrors> <rat.ignoreErrors>true</rat.ignoreErrors>
<maven.compiler.source>8</maven.compiler.source> <!-- <maven.compiler.source>8</maven.compiler.source>-->
<maven.compiler.target>8</maven.compiler.target> <!-- <maven.compiler.target>8</maven.compiler.target>-->
<maven-version>3.8.6</maven-version> <maven-version>4.0.0-beta-6-SNAPSHOT</maven-version>
<maven-plugin-tools-version>3.6.4</maven-plugin-tools-version> <maven-plugin-tools-version>3.6.4</maven-plugin-tools-version>
</properties> </properties>

90
pom.xml
View File

@ -170,6 +170,8 @@ under the License.
<wagonVersion>3.5.3</wagonVersion> <wagonVersion>3.5.3</wagonVersion>
<woodstoxVersion>7.1.0</woodstoxVersion> <woodstoxVersion>7.1.0</woodstoxVersion>
<xmlunitVersion>2.10.0</xmlunitVersion> <xmlunitVersion>2.10.0</xmlunitVersion>
<!-- maven.version -->
<maven-version>${project.version}</maven-version>
</properties> </properties>
<!--bootstrap-start-comment--> <!--bootstrap-start-comment-->
@ -181,157 +183,157 @@ under the License.
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId> <artifactId>maven-artifact</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-builder-support</artifactId> <artifactId>maven-builder-support</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-jline</artifactId> <artifactId>maven-jline</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-logging</artifactId> <artifactId>maven-logging</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId> <artifactId>maven-core</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-impl</artifactId> <artifactId>maven-impl</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId> <artifactId>maven-embedder</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-cli</artifactId> <artifactId>maven-cli</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId> <artifactId>maven-model</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-core</artifactId> <artifactId>maven-api-core</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-meta</artifactId> <artifactId>maven-api-meta</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-model</artifactId> <artifactId>maven-api-model</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-settings</artifactId> <artifactId>maven-api-settings</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-spi</artifactId> <artifactId>maven-api-spi</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-toolchain</artifactId> <artifactId>maven-api-toolchain</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-plugin</artifactId> <artifactId>maven-api-plugin</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-xml</artifactId> <artifactId>maven-api-xml</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-di</artifactId> <artifactId>maven-api-di</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-metadata</artifactId> <artifactId>maven-api-metadata</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-api-cli</artifactId> <artifactId>maven-api-cli</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-di</artifactId> <artifactId>maven-di</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId> <artifactId>maven-model-builder</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId> <artifactId>maven-plugin-api</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId> <artifactId>maven-repository-metadata</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId> <artifactId>maven-resolver-provider</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId> <artifactId>maven-settings</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId> <artifactId>maven-settings-builder</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-toolchain-model</artifactId> <artifactId>maven-toolchain-model</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-toolchain-builder</artifactId> <artifactId>maven-toolchain-builder</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-xml</artifactId> <artifactId>maven-xml</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven</groupId> <groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId> <artifactId>maven-compat</artifactId>
<version>${project.version}</version> <version>${maven-version}</version>
</dependency> </dependency>
<!--bootstrap-end-comment--> <!--bootstrap-end-comment-->
<dependency> <dependency>
@ -773,6 +775,7 @@ under the License.</licenseText>
<exclude>src/test/resources*/**</exclude> <exclude>src/test/resources*/**</exclude>
<exclude>src/test/projects/**</exclude> <exclude>src/test/projects/**</exclude>
<exclude>src/test/remote-repo/**</exclude> <exclude>src/test/remote-repo/**</exclude>
<exclude>its/**</exclude>
<exclude>**/*.odg</exclude> <exclude>**/*.odg</exclude>
<exclude>**/*.svg</exclude> <exclude>**/*.svg</exclude>
<exclude>.asf.yaml</exclude> <exclude>.asf.yaml</exclude>
@ -837,6 +840,19 @@ under the License.</licenseText>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins>
</build>
<profiles>
<profile>
<id>graph</id>
<activation>
<os>
<family>!windows</family>
</os>
</activation>
<build>
<plugins>
<plugin> <plugin>
<groupId>org.fusesource.mvnplugins</groupId> <groupId>org.fusesource.mvnplugins</groupId>
<artifactId>maven-graph-plugin</artifactId> <artifactId>maven-graph-plugin</artifactId>
@ -883,8 +899,7 @@ under the License.</licenseText>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile>
<profiles>
<profile> <profile>
<id>apache-release</id> <id>apache-release</id>
<build> <build>
@ -1014,5 +1029,14 @@ under the License.</licenseText>
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>run-its</id>
<modules>
<module>its</module>
</modules>
<properties>
<mavenDistro>${session.rootDirectory}/apache-maven/target/apache-maven-${project.version}-bin.zip</mavenDistro>
</properties>
</profile>
</profiles> </profiles>
</project> </project>