This is an automated email from the ASF dual-hosted git repository. michaelo pushed a commit to branch maven-3.8.x in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git
The following commit(s) were added to refs/heads/maven-3.8.x by this push: new 3bb2a033c [MNG-7716] Backport to 3.8.x 3bb2a033c is described below commit 3bb2a033ca4bfe605e6a00d64269f19da1e05a6d Author: Christoph Läubrich <christ...@laeubi-soft.de> AuthorDate: Thu Mar 2 19:15:39 2023 +0100 [MNG-7716] Backport to 3.8.x Co-authored-by: Michael Osipov <micha...@apache.org> --- .../org/apache/maven/it/IntegrationTestSuite.java | 1 + .../maven/it/MavenITmng7716BuildDeadlock.java | 65 ++++++++++++++++++++++ .../src/test/resources-filtered/bootstrap.txt | 1 + core-it-suite/src/test/resources/mng-7716/pom.xml | 19 +++++++ .../src/test/resources/mng-7716/settings/pom.xml | 6 ++ 5 files changed, 92 insertions(+) diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 6000016c4..4191c7e4f 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -106,6 +106,7 @@ public class IntegrationTestSuite // Tests that don't run stable and need to be fixed // ------------------------------------------------------------------------------------------------------------- // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng7716BuildDeadlock.class ); suite.addTestSuite( MavenITmng7679SingleMojoNoPomTest.class ); suite.addTestSuite( MavenITmng7568SettingsProfileDeactivationTest.class ); suite.addTestSuite( MavenITmng7529VersionRangeRepositorySelection.class ); diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java new file mode 100644 index 000000000..c58955ccb --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7716BuildDeadlock.java @@ -0,0 +1,65 @@ +package org.apache.maven.it; + +/* + * 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. + */ + +import java.io.File; + +import org.apache.maven.it.util.ResourceExtractor; + +/** + * This is a test set for + * <a href="https://issues.apache.org/jira/browse/MNG-7716">MNG-7716</a>. + * Executing the project should not deadlock + * + */ +public class MavenITmng7716BuildDeadlock + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng7716BuildDeadlock() + { + super( "[3.8.8,3.9.0),[3.9.1,4.0.0-alpha-1),[4.0.0-alpha-5,)" ); + } + + /** + * Verify that maven invocation works (no NPE/error happens). + * + * @throws Exception in case of failure + */ + public void testNoDeadlockAtVersionUpdate() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7716" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.addCliOption( "-f" ); + verifier.addCliOption( "settings" ); + verifier.setLogFileName( "log-settings.txt" ); + verifier.executeGoal( "install" ); + verifier.verifyErrorFreeLog(); + + verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.addCliOption( "-T1C" ); + verifier.addCliOption( "-DnewVersion=1.2.3" ); + verifier.executeGoal( "org.codehaus.mojo:versions-maven-plugin:2.15.0:set" ); + verifier.verifyErrorFreeLog(); + } + +} diff --git a/core-it-suite/src/test/resources-filtered/bootstrap.txt b/core-it-suite/src/test/resources-filtered/bootstrap.txt index 23e245932..4d7bca2d9 100644 --- a/core-it-suite/src/test/resources-filtered/bootstrap.txt +++ b/core-it-suite/src/test/resources-filtered/bootstrap.txt @@ -142,6 +142,7 @@ org.apache.maven:maven-settings:2.1.0 org.apache.maven:maven-settings:3.1.1 org.codehaus.gmavenplus:gmavenplus-plugin:1.11.0 org.codehaus.mojo:flatten-maven-plugin:1.0.0 +org.codehaus.mojo:versions-maven-plugin:2.15.0 org.codehaus.plexus:plexus-classworlds:2.5.1 org.codehaus.plexus:plexus-component-annotations:1.5.5 org.codehaus.plexus:plexus-component-metadata:1.5.5 diff --git a/core-it-suite/src/test/resources/mng-7716/pom.xml b/core-it-suite/src/test/resources/mng-7716/pom.xml new file mode 100644 index 000000000..7f0cd80d9 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-7716/pom.xml @@ -0,0 +1,19 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>mng</groupId> + <artifactId>base</artifactId> + <version>1.2.3</version> + <packaging>pom</packaging> + <build> + <extensions> + <extension> + <groupId>mng</groupId> + <artifactId>settings</artifactId> + <version>0.0.1-SNAPSHOT</version> + </extension> + </extensions> + </build> + <modules> + <module>settings</module> + </modules> +</project> diff --git a/core-it-suite/src/test/resources/mng-7716/settings/pom.xml b/core-it-suite/src/test/resources/mng-7716/settings/pom.xml new file mode 100644 index 000000000..e1a0685e5 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-7716/settings/pom.xml @@ -0,0 +1,6 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>mng</groupId> + <version>0.0.1-SNAPSHOT</version> + <artifactId>settings</artifactId> +</project> \ No newline at end of file