Skip to content

Commit 664c16e

Browse files
[MPLUGIN-431] Remove deprecated items from new maven-plugin-report-plugin
1 parent 8a76400 commit 664c16e

File tree

13 files changed

+51
-430
lines changed

13 files changed

+51
-430
lines changed

maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ else if ( !goalPrefix.equals( defaultGoalPrefix ) )
107107
static String getDefaultGoalPrefix( MavenProject project )
108108
{
109109
String defaultGoalPrefix;
110-
if ( "maven-plugin".equalsIgnoreCase( project.getArtifactId() ) )
110+
if ( "maven-plugin-report-plugin".equalsIgnoreCase( project.getArtifactId() ) )
111+
{
112+
defaultGoalPrefix = "plugin-report";
113+
}
114+
else if ( "maven-plugin".equalsIgnoreCase( project.getArtifactId() ) )
111115
{
112116
defaultGoalPrefix = project.getGroupId().substring( project.getGroupId().lastIndexOf( '.' ) + 1 );
113117
}

maven-plugin-plugin/src/test/java/org/apache/maven/plugin/plugin/DescriptorGeneratorMojoTest.java

+26-14
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,39 @@
1919
* under the License.
2020
*/
2121

22-
import static org.hamcrest.MatcherAssert.assertThat;
23-
import static org.hamcrest.CoreMatchers.is;
22+
import java.util.stream.Stream;
2423

2524
import org.apache.maven.project.MavenProject;
26-
import org.junit.jupiter.api.Test;
25+
import org.junit.jupiter.params.ParameterizedTest;
26+
import org.junit.jupiter.params.provider.Arguments;
27+
import org.junit.jupiter.params.provider.MethodSource;
28+
29+
import static org.hamcrest.CoreMatchers.is;
30+
import static org.hamcrest.MatcherAssert.assertThat;
31+
import static org.junit.jupiter.params.provider.Arguments.arguments;
2732

2833
// at least one test class must be public for test-javadoc report
2934
public class DescriptorGeneratorMojoTest
3035
{
31-
@Test
32-
void defaultGoalPrefix()
36+
public static Stream<Arguments> goalPrefixes()
37+
{
38+
return Stream.of(
39+
arguments( null, "maven-plugin-plugin", "plugin" ),
40+
arguments( null, "maven-plugin-report-plugin", "plugin-report" ),
41+
arguments( null, "maven-default-plugin", "default" ),
42+
arguments( null, "default-maven-plugin", "default" ),
43+
arguments( null, "default-maven-plugin", "default" ),
44+
arguments( "foo.bar", "maven-plugin", "bar" ),
45+
arguments( "foo", "maven-plugin", "foo" )
46+
);
47+
}
48+
49+
@ParameterizedTest
50+
@MethodSource("goalPrefixes")
51+
void defaultGoalPrefix(String groupId, String artifactId, String expectedGoal)
3352
{
34-
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( null, "maven-plugin-plugin" ) ),
35-
is( "plugin" ) );
36-
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( null, "maven-default-plugin" ) ),
37-
is( "default" ) );
38-
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( null, "default-maven-plugin" ) ),
39-
is( "default" ) );
40-
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( "foo.bar", "maven-plugin" ) ),
41-
is( "bar" ) );
42-
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( "foo", "maven-plugin" ) ), is( "foo" ) );
53+
assertThat( DescriptorGeneratorMojo.getDefaultGoalPrefix( newProject( groupId, artifactId ) ),
54+
is( expectedGoal ) );
4355
}
4456

4557
private MavenProject newProject( final String groupId, final String artifactId )

maven-plugin-report-plugin/src/it/plugin-info-jdk/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ under the License.
4545
<module>propertyRelease</module>
4646
<module>pluginManagement</module>
4747
<module>plugin</module>
48-
<module>requirement</module>
4948
</modules>
5049

5150
<build>

maven-plugin-report-plugin/src/it/plugin-info-jdk/requirement/pom.xml

-78
This file was deleted.

maven-plugin-report-plugin/src/it/plugin-info-jdk/requirement/src/main/resources/META-INF/maven/plugin-enhanced.xml

-69
This file was deleted.

maven-plugin-report-plugin/src/it/plugin-info-jdk/verify.groovy

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ assert new File( basedir, 'property/target/site/plugin-info.html' ).text.contain
2121
assert new File( basedir, 'propertyRelease/target/site/plugin-info.html' ).text.contains( '<td>8</td>' )
2222
assert new File( basedir, 'pluginManagement/target/site/plugin-info.html' ).text.contains( '<td>1.4</td>' )
2323
assert new File( basedir, 'plugin/target/site/plugin-info.html' ).text.contains( '<td>1.5</td>' )
24-
assert new File( basedir, 'requirement/target/site/plugin-info.html' ).text.contains( '<td>1.8</td>' )
2524

26-
return true;
25+
return true;

maven-plugin-report-plugin/src/it/plugin-report/verify.groovy

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ assert pluginInfo.isFile()
2525

2626
assert !pluginInfo.text.contains('Memory')
2727
assert !pluginInfo.text.contains('Disk Space')
28-
assert !pluginInfo.text.contains('No minimum requirement.')
28+
// missing prerequisites in pom
29+
assert pluginInfo.text.contains('No minimum requirement.')

0 commit comments

Comments
 (0)