You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/02/28 21:17:01 UTC
[maven-integration-testing] branch maven-3.6.x-compat created (now
d7465b5)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch maven-3.6.x-compat
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git.
at d7465b5 Make tests verifiable with at least Maven 3.6.3
This branch includes the following new commits:
new d7465b5 Make tests verifiable with at least Maven 3.6.3
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-integration-testing] 01/01: Make tests verifiable with at
least Maven 3.6.3
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch maven-3.6.x-compat
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git
commit d7465b5406be3462bfdab9d206c1f8826ed351a2
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Jan 16 14:41:17 2021 +0100
Make tests verifiable with at least Maven 3.6.3
---
.../MavenITmng5572ReactorPluginExtensionsTest.java | 9 ++++++-
.../maven/it/MavenITmng5937MavenWrapper.java | 29 +++++++++++++++-------
...ng6759TransitiveDependencyRepositoriesTest.java | 9 ++++++-
.../maven/it/AbstractMavenIntegrationTestCase.java | 10 ++++++++
run-its.bat | 5 ++++
run-its.sh | 6 ++++-
6 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
index f82ee8c..433ebc6 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5572ReactorPluginExtensionsTest.java
@@ -61,7 +61,14 @@ public class MavenITmng5572ReactorPluginExtensionsTest
verifier.setAutoclean( false );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
- verifier.verifyTextInLog( "[WARNING] 'project' uses 'org.apache.maven.its.mng5572:plugin' as extension which is not possible within the same reactor build. This plugin was pulled from the local repository!" );
+ if ( getMavenVersion().getMajorVersion() <= 3 )
+ {
+ verifier.verifyTextInLog( "[WARNING] project uses org.apache.maven.its.mng5572:plugin as extensions, which is not possible within the same reactor build. This plugin was pulled from the local repository!" );
+ }
+ else
+ {
+ verifier.verifyTextInLog( "[WARNING] 'project' uses 'org.apache.maven.its.mng5572:plugin' as extension which is not possible within the same reactor build. This plugin was pulled from the local repository!" );
+ }
verifier.resetStreams();
}
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java
index 4b47d80..5f8dff1 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java
@@ -54,23 +54,34 @@ public class MavenITmng5937MavenWrapper
{
super( "[4.0.0-alpha-1,)" );
- String localRepo = System.getProperty("maven.repo.local");
-
envVars = new HashMap<>( 4 );
- envVars.put( "MVNW_REPOURL", Paths.get( localRepo ).toUri().toURL().toString() );
- envVars.put( "MVNW_VERBOSE", "true" );
- String javaHome = System.getenv( "JAVA_HOME" );
- if ( javaHome != null )
+
+ if ( !isSkipped() )
{
- // source needs to call the javac executable.
- // if JAVA_HOME is not set, ForkedLauncher sets it to java.home, which is the JRE home
- envVars.put( "JAVA_HOME", javaHome );
+ String localRepo = System.getProperty( "maven.repo.local" );
+ if ( localRepo != null )
+ {
+ envVars.put( "MVNW_REPOURL", Paths.get( localRepo ).toUri().toURL().toString() );
+ envVars.put( "MVNW_VERBOSE", "true" );
+ }
+ String javaHome = System.getenv( "JAVA_HOME" );
+ if ( javaHome != null )
+ {
+ // source needs to call the javac executable.
+ // if JAVA_HOME is not set, ForkedLauncher sets it to java.home, which is the JRE home
+ envVars.put( "JAVA_HOME", javaHome );
+ }
}
}
public void setUp()
throws Exception
{
+ if ( isSkipped() )
+ {
+ return;
+ }
+
String mavenDist = System.getProperty( "maven.distro" );
if ( StringUtils.isEmpty( mavenDist ) )
{
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java
index 21eae3c..45a6665 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6759TransitiveDependencyRepositoriesTest.java
@@ -55,7 +55,14 @@ public class MavenITmng6759TransitiveDependencyRepositoriesTest extends Abstract
Verifier verifier = newVerifier( dependencyCProjectDir.getAbsolutePath() );
verifier.deleteDirectory( "target" );
- verifier.addCliOption( "-DaltDeploymentRepository=customRepo::" + customRepoUri );
+ if ( getMavenVersion().getMajorVersion() <= 3 )
+ {
+ verifier.addCliOption( "-DaltDeploymentRepository=customRepo::default::" + customRepoUri );
+ }
+ else
+ {
+ verifier.addCliOption( "-DaltDeploymentRepository=customRepo::" + customRepoUri );
+ }
verifier.executeGoal( "deploy" );
verifier.verifyErrorFreeLog();
return customRepoUri;
diff --git a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java
index bb0a101..a30b07b 100644
--- a/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java
+++ b/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it/AbstractMavenIntegrationTestCase.java
@@ -202,6 +202,16 @@ public abstract class AbstractMavenIntegrationTestCase
}
}
+ /**
+ * Can be called by version specific setUp calls
+ *
+ * @return
+ */
+ protected final boolean isSkipped()
+ {
+ return skip;
+ }
+
protected void runTest()
throws Throwable
{
diff --git a/run-its.bat b/run-its.bat
index abc501b..9bdb4fd 100644
--- a/run-its.bat
+++ b/run-its.bat
@@ -37,7 +37,12 @@ CALL :maven && CALL :maven-integration-testing
CALL mvn clean verify -DdistributionFileName=${project.artifactId} -f "%_MAVENCODEBASE%" || exit /B
:maven-integration-testing
+if exist "%_MAVENCODEBASE%\maven-wrapper\target\maven-wrapper.jar" (
CALL mvn clean install -Prun-its,embedded -Dmaven.repo.local="%cd%\repo" -DmavenDistro="%_MAVENCODEBASE%\apache-maven\target\apache-maven-bin.zip" -DwrapperDistroDir="%_MAVENCODEBASE%\apache-maven\target" -DmavenWrapper="%_MAVENCODEBASE%\maven-wrapper\target\maven-wrapper.jar" || exit /B
+)
+else (
+ CALL mvn clean install -Prun-its,embedded,!maven-wrapper -Dmaven.repo.local="%cd%\repo" -DmavenDistro="%_MAVENCODEBASE%\apache-maven\target\apache-maven-bin.zip" || exit /B
+)
:normalizePath
SET _MAVENCODEBASE=%~dpfn1
diff --git a/run-its.sh b/run-its.sh
index 028c39a..2f85609 100755
--- a/run-its.sh
+++ b/run-its.sh
@@ -30,7 +30,11 @@ else
*) MAVENCODEBASE="$PWD/$MAVENCODEBASE" ;;
esac
mvn clean verify -P versionlessMavenDist -f "$MAVENCODEBASE" || exit $?
- mvn clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo -DmavenDistro="$MAVENCODEBASE/apache-maven/target/apache-maven-bin.zip" -DwrapperDistroDir="$MAVENCODEBASE/apache-maven/target" -DmavenWrapper="$MAVENCODEBASE/maven-wrapper/target/maven-wrapper.jar"
+ if [ -f "$MAVENCODEBASE/maven-wrapper/target/maven-wrapper.jar" ] ; then
+ mvn clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo -DmavenDistro="$MAVENCODEBASE/apache-maven/target/apache-maven-bin.zip" -DwrapperDistroDir="$MAVENCODEBASE/apache-maven/target" -DmavenWrapper="$MAVENCODEBASE/maven-wrapper/target/maven-wrapper.jar" || exit $
+ else
+ mvn clean install -Prun-its,embedded,!maven-wrapper -Dmaven.repo.local=`pwd`/repo -DmavenDistro="$MAVENCODEBASE/apache-maven/target/apache-maven-bin.zip" || exit $?
+ fi
fi