[MWRAPPER-14] remove wrapper-related ITs: not in core any more

This commit is contained in:
Hervé Boutemy 2021-12-26 11:15:17 +01:00
parent 864723989e
commit 3cb3dbe2fa
10 changed files with 5 additions and 412 deletions

View File

@ -24,17 +24,7 @@ Maven Core Integration Tests
If you want to run the integration tests against a custom build of Maven use the following command:
```
export MAVENCODEBASE=<path-to-maven-codebase>
```
You can choose to build the maven project from here with:
```
mvn verify -P local-it -f "$MAVENCODEBASE"
```
Now run (don't forget to update the versions!)
```
mvn clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo -DmavenDistro="$MAVENCODEBASE/apache-maven/target/apache-maven-<VERSION>-bin.zip" -DwrapperDistroDir="$MAVENCODEBASE/apache-maven/target" -DmavenWrapper="$MAVENCODEBASE/maven-wrapper/target/maven-wrapper.jar"
mvn clean install -Prun-its -Dmaven.repo.local=`pwd`/repo -DmavenDistro=/path/to/apache-maven-dist.zip
```
or if behind a proxy

View File

@ -58,12 +58,6 @@ under the License.
ITs that don't require to fork Maven can also be run from the IDE using the Maven projects from the workspace if the
Maven dependencies are added to the test class path.
To test with the maven wrapper, you should add the wrapperDistroDir too.
mvn clean test -Prun-its -Dmaven.repo.local=<path-to-local-repo> -DmavenDistro=<path-to-bin-archive> -DwrapperDistroDir=<path-to-wrapper-distro-directory> -DmavenWrapper=<path-to-wrapper-jar>
Tests can pick up the maven.wrapper.distrodir system property to unpack it into their testDir to verify the wrapper.
If you're behind a proxy, use the system properties proxy.host, proxy.port, proxy.user, proxy.pass and
proxy.nonProxyHosts to specify the required proxy setup for the ITs. Alternatively, set the system property
maven.it.central to a URL of a local repository manager (anonymous authentication only) that proxies the
@ -147,17 +141,6 @@ under the License.
<artifactId>guava</artifactId>
<version>16.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.3.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
@ -198,14 +181,6 @@ under the License.
<name>maven.it.global-settings.dir</name>
<value>${project.build.testOutputDirectory}</value>
</property>
<property>
<name>maven.wrapper.distrodir</name>
<value>${wrapperDistroDir}</value>
</property>
<property>
<name>maven.distro</name>
<value>${mavenDistro}</value>
</property>
</systemProperties>
</configuration>
</plugin>
@ -482,36 +457,6 @@ under the License.
</plugins>
</build>
</profile>
<profile>
<id>maven-wrapper</id>
<activation>
<property>
<name>mavenWrapper</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<!-- install, so it can be called via a URL -->
<execution>
<id>prepare-wrapper</id>
<phase>process-test-resources</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${mavenWrapper}</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>emma</id>
<properties>

View File

@ -148,7 +148,6 @@ public class IntegrationTestSuite
suite.addTestSuite( MavenITmng6057CheckReactorOrderTest.class );
suite.addTestSuite( MavenITmng5965ParallelBuildMultipliesWorkTest.class );
suite.addTestSuite( MavenITmng5958LifecyclePhaseBinaryCompat.class );
suite.addTestSuite( MavenITmng5937MavenWrapper.class );
suite.addTestSuite( MavenITmng5935OptionalLostInTranstiveManagedDependenciesTest.class );
suite.addTestSuite( MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.class );
suite.addTestSuite( MavenITmng5895CIFriendlyUsageWithPropertyTest.class );

View File

@ -1,194 +0,0 @@
package org.apache.maven.it;
import java.io.BufferedWriter;
/*
* 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 java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.charset.StandardCharsets;
import java.nio.file.StandardOpenOption;
import java.util.HashMap;
import java.util.Map;
import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
import org.codehaus.plexus.logging.console.ConsoleLogger;
import org.codehaus.plexus.util.StringUtils;
/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-5937">MNG-5937</a>.
*
*/
public class MavenITmng5937MavenWrapper
extends AbstractMavenIntegrationTestCase
{
private Path wrapperDistro;
private final Map<String,String> envVars;
private final Path baseDir = Paths.get( "target/test-classes/mng-5937 wrapper" );
private ZipUnArchiver zipUnArchiver = new ZipUnArchiver();
public MavenITmng5937MavenWrapper()
throws Exception
{
super( "[4.0.0-alpha-1,)" );
envVars = new HashMap<>( 4 );
if ( !isSkipped() )
{
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 ) )
{
throw new IllegalStateException( "Missing maven.distro=${mavenDistro} parameter to test maven-wrapper: see run ITs instructions" );
}
Verifier distInstaller = newVerifier( baseDir.toAbsolutePath().toFile().toString() );
distInstaller.setSystemProperty( "file", mavenDist );
distInstaller.setSystemProperty( "groupId", "org.apache.maven" );
distInstaller.setSystemProperty( "artifactId", "apache-maven" );
distInstaller.setSystemProperty( "version", getMavenVersion().toString() );
distInstaller.setSystemProperty( "classifier", "bin" );
distInstaller.setSystemProperty( "packaging", "zip" );
distInstaller.executeGoal( "org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file" );
String distroValue = System.getProperty( "maven.wrapper.distrodir" );
if ( StringUtils.isEmpty( distroValue ) )
{
throw new IllegalStateException( "Missing maven.wrapper.distrodir=${wrapperDistroDir} parameter to test maven-wrapper: see run ITs instructions" );
}
wrapperDistro = Paths.get( distroValue );
}
public void testitMNG5937Bin()
throws Exception
{
final File testDir = baseDir.resolve( "bin" ).toFile();
unpack( testDir.toPath(), "bin" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.setDebug( true );
verifier.executeGoal( "validate", envVars );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
public void testitMNG5937Script()
throws Exception
{
final File testDir = baseDir.resolve( "script" ).toFile();
unpack( testDir.toPath(), "script" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.setDebug( true );
verifier.executeGoal( "validate", envVars );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
public void testitMNG5937Source()
throws Exception
{
final File testDir = baseDir.resolve( "source" ).toFile();
unpack( testDir.toPath(), "source" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.setDebug( true );
verifier.executeGoal( "validate", envVars );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
public void testitMNG5937WrapperProperties()
throws Exception
{
final File testDir = baseDir.resolve( "properties" ).toFile();
unpack( testDir.toPath(), "bin" );
Path p = baseDir.resolve( "properties/.mvn/wrapper/maven-wrapper.properties" );
try ( BufferedWriter out = Files.newBufferedWriter( p, StandardCharsets.ISO_8859_1,
StandardOpenOption.TRUNCATE_EXISTING ) )
{
String localRepo = System.getProperty("maven.repo.local");
out.append( "distributionUrl = " + Paths.get( localRepo ).toUri().toASCIIString() )
.append( "org/apache/maven/apache-maven/")
.append( getMavenVersion().toString() )
.append( "/apache-maven-")
.append( getMavenVersion().toString() )
.append( "-bin.zip" );
}
envVars.remove( "MVNW_REPOURL" );
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.setDebug( true );
verifier.executeGoal( "validate", envVars );
verifier.verifyErrorFreeLog();
verifier.resetStreams();
}
private void unpack( Path target, String classifier ) throws IOException
{
Path distro = wrapperDistro.resolve( "apache-maven-wrapper-" + getMavenVersion() + '-' + classifier + ".zip" );
zipUnArchiver.setSourceFile( distro.toFile() );
zipUnArchiver.setDestDirectory( target.toFile() );
zipUnArchiver.enableLogging( new ConsoleLogger() );
zipUnArchiver.extract();
}
}

View File

@ -1,28 +0,0 @@
<?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>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng5937</groupId>
<artifactId>test</artifactId>
<version>1</version>
</project>

View File

@ -1,31 +0,0 @@
<?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>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng5937</groupId>
<artifactId>test</artifactId>
<version>1</version>
<name>Maven Integration Test :: MNG-5937</name>
</project>

View File

@ -1,28 +0,0 @@
<?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>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng5937</groupId>
<artifactId>test</artifactId>
<version>1</version>
</project>

View File

@ -1,28 +0,0 @@
<?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>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.mng5937</groupId>
<artifactId>test</artifactId>
<version>1</version>
</project>

View File

@ -16,28 +16,10 @@
@REM specific language governing permissions and limitations
@REM under the License.
@REM
@ECHO OFF
@IF "%MAVENCODEBASE%"=="" (
@ECHO Please SET MAVENCODEBASE / $env:MAVENCODEBASE
@GOTO :eof
)
CALL :normalizePath %MAVENCODEBASE%
@REM How JvZ runs the ITs from a clean slate if it would be on Windows
mvn clean install -U -Prun-its,embedded -Dmaven.repo.local=%cd%\repo
@REM If behind a proxy try this..
@REM mvn clean install -Prun-its,embedded -Dmaven.repo.local=%cd%\repo -Dproxy.host=<host> -Dproxy.port=<port> -Dproxy.user= -Dproxy.pass= -Dproxy.nonProxyHosts=<hosts>
:: ========== FUNCTIONS ==========
CALL mvn clean verify -DdistributionFileName=${project.artifactId} -f "%_MAVENCODEBASE%" || exit /B
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-wrapper\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
)
@GOTO :eof
:normalizePath
SET _MAVENCODEBASE=%~dpfn1

View File

@ -22,21 +22,7 @@
# How I run the ITs from a clean slate. Though I do this with a primed Nexus instance. JvZ.
# build maven core using -PversionlessMavenDist
if [ -z "$MAVENCODEBASE" ] ; then
echo Please export MAVENCODEBASE
else
case "$MAVENCODEBASE" in
/*) ;;
*) MAVENCODEBASE="$PWD/$MAVENCODEBASE" ;;
esac
mvn clean verify -P versionlessMavenDist -f "$MAVENCODEBASE" || exit $?
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-wrapper/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
mvn clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo
# If behind a proxy try this