Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public static Test suite()
// Tests that don't run stable and need to be fixed
// -------------------------------------------------------------------------------------------------------------
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng7353CliGoalInvocationTest.class );
suite.addTestSuite( MavenITmng7504NotWarnUnsupportedReportPluginsTest.class );
suite.addTestSuite( MavenITmng7160ExtensionClassloader.class );
suite.addTestSuite( MavenITmng7468UnsupportedPluginsParametersTest.class );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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;

/**
* Tests new <code>mvn prefix:version:goal</code>,
* <a href="https://issues.apache.org/jira/browse/MNG-7353">MNG-7353</a>.
*/
public class MavenITmng7353CliGoalInvocationTest
extends AbstractMavenIntegrationTestCase
{
public MavenITmng7353CliGoalInvocationTest()
{
super( "[3.9.0,)" );
}

private void run( String id, String goal, String expectedInvocation )
throws Exception
{
File basedir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7353-cli-goal-invocation" );
Verifier verifier = newVerifier( basedir.getAbsolutePath() );
verifier.setLogFileName( id + ".txt" );
verifier.executeGoal( goal );
verifier.verifyTextInLog( "[INFO] --- " + expectedInvocation );
verifier.resetStreams();
}

public void testPrefixGoal()
throws Exception
{
run( "pluginPrefix-goal", "dependency:list", "maven-dependency-plugin:3.3.0:list (default-cli)" );
}

public void testPrefixGoalAtId()
throws Exception
{
run( "pluginPrefix-goal@id", "dependency:list@id", "maven-dependency-plugin:3.3.0:list (id)" );
}

/**
* new pluginPrefix:version:goal in Maven 3.9.0
*/
public void testPrefixVersionGoal()
throws Exception
{
run( "pluginPrefix-version-goal", "dependency:3.1.1:list", "maven-dependency-plugin:3.1.1:list (default-cli)" );
}

/**
* new pluginPrefix:version:goal in Maven 3.9.0
*/
public void testPrefixVersionGoalAtId()
throws Exception
{
run( "pluginPrefix-goal@id", "dependency:3.1.1:list@id", "maven-dependency-plugin:3.1.1:list (id)" );
}

public void testGroupIdArtifactIdGoal()
throws Exception
{
run( "groupId-artifactId-goal", "org.apache.maven.plugins:maven-dependency-plugin:list", "maven-dependency-plugin:3.3.0:list (default-cli)" );
}

public void testGroupIdArtifactIdGoalAtId()
throws Exception
{
run( "groupId-artifactId-goal@id", "org.apache.maven.plugins:maven-dependency-plugin:list@id", "maven-dependency-plugin:3.3.0:list (id)" );
}

public void testGroupIdArtifactIdVersionGoal()
throws Exception
{
run( "groupId-artifactId-version-goal", "org.apache.maven.plugins:maven-dependency-plugin:3.1.1:list", "maven-dependency-plugin:3.1.1:list (default-cli)" );
}

public void testGroupIdArtifactIdVersionGoalAtId()
throws Exception
{
run( "groupId-artifactId-version-goal@id", "org.apache.maven.plugins:maven-dependency-plugin:3.1.1:list@id", "maven-dependency-plugin:3.1.1:list (id)" );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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.mng7353</groupId>
<artifactId>test</artifactId>
<version>1</version>

<name>Maven Integration Test :: MNG-7353</name>
<description>
Verify that "mvn pluginPrefix:version:goal" works and does not break any other goal invocation format
</description>

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>