diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3057VersionExprTransformationsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3057VersionExprTransformationsTest.java index b9f64a60557a..1e46d5e929c1 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3057VersionExprTransformationsTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3057VersionExprTransformationsTest.java @@ -70,7 +70,8 @@ public void testitMNG3057 () verifier.addCliOption( "-V" ); verifier.addCliOption( "-DtestVersion=1" ); - verifier.addCliOption( "-f pom-filtered.xml" ); + verifier.addCliOption( "-f" ); + verifier.addCliOption( "pom-filtered.xml" ); verifier.executeGoal( "generate-sources" ); verifier.verifyErrorFreeLog(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java index b2e2a34b3188..ef6fe78401cb 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3268MultipleHyphenPCommandLineTest.java @@ -48,7 +48,8 @@ public void testMultipleProfileParams() verifier.addCliOption( "-Pprofile1,profile2" ); verifier.addCliOption( "-Pprofile3" ); - verifier.addCliOption( "-P profile4" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "profile4" ); verifier.executeGoal( "package" ); verifier.verifyErrorFreeLog(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java index 0630fd6575e8..3b3c8de807c7 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3545ProfileDeactivationTest.java @@ -81,7 +81,8 @@ public void testDeactivateDefaultProfilesHyphen() // Deactivate active by default profiles verifier.addCliOption( "-P-profile1" ); - verifier.addCliOption( "-P -profile2" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "-profile2" ); verifier.executeGoal( "validate" ); @@ -103,7 +104,8 @@ public void testDeactivateDefaultProfilesExclamation() // Deactivate active by default profiles verifier.addCliOption( "-P!profile1" ); - verifier.addCliOption( "-P !profile2" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "!profile2" ); verifier.executeGoal( "validate" ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java index 778c662d5f2f..51359f598a7c 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3641ProfileActivationWarningTest.java @@ -51,7 +51,8 @@ public void testitMNG3641() verifier.deleteArtifact( "org.apache.maven.its.mng3641", "parent", "1.0", "pom" ); // (1) make sure the profile is found. Must not contain a warning. - verifier.addCliOption( "-P mng-3641-it-provided-profile" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-it-provided-profile" ); verifier.setLogFileName( "log-1.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); @@ -62,7 +63,8 @@ public void testitMNG3641() // (2) make sure the profile was not found and a warning was printed. verifier = newVerifier( testDir.getAbsolutePath() ); - verifier.addCliOption( "-P mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ); verifier.setLogFileName( "log-2.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); @@ -74,7 +76,8 @@ public void testitMNG3641() // (3) make sure the first profile is found while the other is not and a warning was printed // accordingly. verifier = newVerifier( testDir.getAbsolutePath() ); - verifier.addCliOption( "-P mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-it-provided-profile,mng-3641-TWlzdGVyIFQgd2FzIGhlcmUuICheX14p" ); verifier.setLogFileName( "log-3.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); @@ -86,7 +89,8 @@ public void testitMNG3641() // (4) make sure the warning is only printed when the profile is missing in all projects verifier = newVerifier( testDir.getAbsolutePath() ); - verifier.addCliOption( "-P mng-3641-it-provided-profile-child" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-it-provided-profile-child" ); verifier.setLogFileName( "log-4.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); @@ -97,7 +101,8 @@ public void testitMNG3641() // (5) make sure the profile is found in subproject. Must not contain a warning. verifier = newVerifier( new File( testDir, "child1" ).getAbsolutePath() ); - verifier.addCliOption( "-P mng-3641-it-provided-profile-child" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-it-provided-profile-child" ); verifier.setLogFileName( "log-5.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); @@ -108,7 +113,8 @@ public void testitMNG3641() // (6) make sure the profile is found from parent in subproject. Must not contain a warning. verifier = newVerifier( new File( testDir, "child1" ).getAbsolutePath() ); - verifier.addCliOption( "-P mng-3641-it-provided-profile" ); + verifier.addCliOption( "-P" ); + verifier.addCliOption( "mng-3641-it-provided-profile" ); verifier.setLogFileName( "log-6.txt" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java index 185fa58e6d2a..4b31f312b19f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3714ToolchainsCliOptionTest.java @@ -62,7 +62,8 @@ public void testitMNG3714() verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); - verifier.addCliOption( "--toolchains toolchains.xml" ); + verifier.addCliOption( "--toolchains" ); + verifier.addCliOption( "toolchains.xml" ); verifier.executeGoal( "initialize" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java index d6f708ec79e4..64d41969a207 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4428FollowHttpRedirectTest.java @@ -160,7 +160,8 @@ private void testit( boolean fromHttp, boolean toHttp, boolean relativeLocation filterProps.setProperty( "@protocol@", fromHttp ? "http" : "https" ); filterProps.setProperty( "@port@", Integer.toString( ( (NetworkConnector) from ).getLocalPort() ) ); verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); - verifier.addCliOption( "-X --settings" ); + verifier.addCliOption( "-X" ); + verifier.addCliOption( "--settings" ); verifier.addCliOption( "settings.xml" ); verifier.setSystemProperty( "javax.net.ssl.trustStore", storePath ); verifier.setSystemProperty( "javax.net.ssl.trustStorePassword", storePwd ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java index abf88976c2fd..4f9bf5c41b0b 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5208EventSpyParallelTest.java @@ -50,7 +50,8 @@ public void testCorrectModuleFails() verifier.deleteDirectory( "target" ); verifier.setSystemProperty( "maven.ext.class.path", "../spy/target/event-spy-0.0.1-SNAPSHOT.jar" ); verifier.addCliOption( "-X" ); - verifier.addCliOption( "-T 2" ); + verifier.addCliOption( "-T" ); + verifier.addCliOption( "2" ); verifier.addCliOption( "-fn" ); verifier.executeGoal( "compile" ); verifier.verifyTextInLog( "ProjectFailed/org.apache.maven.its.mng5208:sub-2" ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java index 9051a4231eef..33abb0d2b7ba 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5338FileOptionToDirectory.java @@ -64,7 +64,8 @@ public void testFileOptionToADirectory() verifier.deleteDirectory( "target" ); verifier.deleteArtifacts( "org.apache.maven.its.mng5338" ); - verifier.addCliOption( "-f project" ); + verifier.addCliOption( "-f" ); + verifier.addCliOption( "project" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java index a90f3a389b80..4d09ee3948ec 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5557ProperlyRestrictedReactor.java @@ -50,7 +50,8 @@ public void testRunningRestrictedReactor() // from the reactor. // verifier.deleteArtifacts( "org.apache.maven.its.mng5557" ); - verifier.addCliOption( "--projects project-0,project-1" ); + verifier.addCliOption( "--projects" ); + verifier.addCliOption( "project-0,project-1" ); try { verifier.executeGoal( "package" ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java index 5061590e44f6..486a01910a7e 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5578SessionScopeTest.java @@ -72,7 +72,10 @@ public void testBasic_multithreaded() // build the test project verifier = newVerifier( projectDir.getAbsolutePath(), "remote" ); verifier.addCliOption( "-Dit-build-extensions=false" ); - verifier.addCliOption( "--builder multithreaded -T 1" ); + verifier.addCliOption( "--builder" ); + verifier.addCliOption( "multithreaded" ); + verifier.addCliOption( "-T" ); + verifier.addCliOption( "1" ); verifier.executeGoal( "package" ); verifier.resetStreams(); verifier.verifyErrorFreeLog(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java index 16896f26da1e..ec95213f16b7 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5716ToolchainsTypeTest.java @@ -60,7 +60,8 @@ public void testitMNG5716() verifier.setAutoclean( false ); verifier.deleteDirectory( "target" ); - verifier.addCliOption( "--toolchains toolchains.xml" ); + verifier.addCliOption( "--toolchains" ); + verifier.addCliOption( "toolchains.xml" ); verifier.executeGoal( "initialize" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java index 85f4a49762d8..4a9525746b1f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java @@ -72,7 +72,8 @@ public void testitShouldResolveTheDependenciesWithoutBuildConsumer() verifier.setAutoclean( false ); verifier.addCliOption( "-Drevision=1.2" ); - verifier.addCliOption( "-pl module-3" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "module-3" ); verifier.executeGoal( "package" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); @@ -101,7 +102,8 @@ public void testitShouldResolveTheDependenciesWithBuildConsumer() verifier.setForkJvm(true); verifier.addCliOption( "-Drevision=1.2" ); - verifier.addCliOption( "-pl module-3" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "module-3" ); verifier.executeGoal( "package" ); verifier.verifyErrorFreeLog(); verifier.resetStreams(); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java index 97217f6edbd0..4e4b6bf9e91f 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java @@ -19,12 +19,10 @@ * under the License. */ -import org.apache.maven.it.util.ResourceExtractor; - import java.io.File; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; + +import org.apache.maven.it.util.ResourceExtractor; /** * This is a collection of test cases for MNG-6118, @@ -43,7 +41,6 @@ public class MavenITmng6118SubmoduleInvocation extends AbstractMavenIntegrationT { private static final String RESOURCE_PATH = "/mng-6118-submodule-invocation-full-reactor"; private final File testDir; - private final Map envVars = new HashMap<>(); public MavenITmng6118SubmoduleInvocation() throws IOException { @@ -60,13 +57,13 @@ public void testInSubModule() throws Exception { // Compile the whole project first. Verifier verifier = newVerifier( testDir.getAbsolutePath() ); - verifier.executeGoal( "compile", envVars ); + verifier.executeGoal( "compile" ); final File submoduleDirectory = new File( testDir, "app" ); verifier = newVerifier( submoduleDirectory.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.setLogFileName( "log-insubmodule.txt" ); - verifier.executeGoal( "compile", envVars ); + verifier.executeGoal( "compile" ); } /** @@ -83,8 +80,9 @@ public void testWithFile() throws Exception verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setAutoclean( false ); verifier.setLogFileName( "log-withfile.txt" ); - verifier.addCliOption( "-f app/pom.xml" ); - verifier.executeGoal( "compile", envVars ); + verifier.addCliOption( "-f" ); + verifier.addCliOption( "app/pom.xml" ); + verifier.executeGoal( "compile" ); } /** @@ -96,9 +94,10 @@ public void testWithFileAndAlsoMake() throws Exception { Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.addCliOption( "-am" ); - verifier.addCliOption( "-f app/pom.xml" ); + verifier.addCliOption( "-f" ); + verifier.addCliOption( "app/pom.xml" ); verifier.setLogFileName( "log-withfilealsomake.txt" ); - verifier.executeGoal( "compile", envVars ); + verifier.executeGoal( "compile" ); verifier.verifyTextInLog( "Building Maven Integration Test :: MNG-6118 :: Library 1.0" ); } @@ -113,7 +112,7 @@ public void testInSubModuleWithAlsoMake() throws Exception Verifier verifier = newVerifier( submoduleDirectory.getAbsolutePath() ); verifier.addCliOption( "-am" ); verifier.setLogFileName( "log-insubmodulealsomake.txt" ); - verifier.executeGoal( "compile", envVars ); + verifier.executeGoal( "compile" ); verifier.verifyTextInLog( "Building Maven Integration Test :: MNG-6118 :: Library 1.0" ); } } diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java index 8690e885a3c2..c0a141460e98 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6511OptionalProjectSelectionTest.java @@ -48,7 +48,8 @@ public void testSelectExistingOptionalProfile() throws VerificationException Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setLogFileName( "log-select-existing.txt" ); - verifier.addCliOption( "-pl ?existing-module" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "?existing-module" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.verifyFilePresent( "existing-module/target/touch.txt" ); // existing-module should have been built. @@ -60,7 +61,8 @@ public void testSelectExistingOptionalProfileByArtifactId() throws VerificationE Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setLogFileName( "log-select-existing-artifact-id.txt" ); - verifier.addCliOption( "-pl ?:existing-module" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "?:existing-module" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.verifyFilePresent( "existing-module/target/touch.txt" ); // existing-module should have been built. @@ -72,7 +74,8 @@ public void testSelectNonExistingOptionalProfile() throws VerificationException Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setLogFileName( "log-select-non-existing.txt" ); - verifier.addCliOption( "-pl ?non-existing-module" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "?non-existing-module" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.verifyFilePresent( "existing-module/target/touch.txt" ); // existing-module should have been built. @@ -84,7 +87,8 @@ public void testDeselectExistingOptionalProfile() throws VerificationException Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setLogFileName( "log-deselect-existing.txt" ); - verifier.addCliOption( "-pl !?existing-module" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "!?existing-module" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.verifyFileNotPresent( "existing-module/target/touch.txt" ); // existing-module should not have been built. @@ -96,7 +100,8 @@ public void testDeselectNonExistingOptionalProfile() throws VerificationExceptio Verifier verifier = newVerifier( testDir.getAbsolutePath() ); verifier.setLogFileName( "log-deselect-non-existing.txt" ); - verifier.addCliOption( "-pl !?non-existing-module" ); + verifier.addCliOption( "-pl" ); + verifier.addCliOption( "!?non-existing-module" ); verifier.executeGoal( "validate" ); verifier.verifyErrorFreeLog(); verifier.verifyFilePresent( "existing-module/target/touch.txt" ); // existing-module should have been built. diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java index 3e6a8834a506..c10cfb64e2fa 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7128BlockExternalHttpReactorTest.java @@ -42,7 +42,9 @@ public void testBlockedHttpRepositoryInPom() throws Exception { final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH ); final Verifier verifier = newVerifier( projectDir.getAbsolutePath() ); - verifier.addCliOption( "-s settings.xml" ); // ITs override global settings that provide blocked mirror: need to define the mirror in dedicated settings + // ITs override global settings that provide blocked mirror: need to define the mirror in dedicated settings + verifier.addCliOption( "-s" ); + verifier.addCliOption( "settings.xml" ); try {