diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/invoker.properties b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/invoker.properties new file mode 100644 index 000000000..9e4e2c08f --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/invoker.properties @@ -0,0 +1,2 @@ +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates +invoker.mavenOpts = -Dversions.outputFile=./output.txt -DoutputEncoding=UTF-8 diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/pom.xml b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/pom.xml new file mode 100644 index 000000000..2e1bc1888 --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + localhost + it-display-extension-updates-002 + + 1.0 + pom + + + + + localhost + dummy-api + 1.0 + + + + + diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/verify.groovy b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/verify.groovy new file mode 100644 index 000000000..42c1f5430 --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184-01/verify.groovy @@ -0,0 +1,3 @@ +def output = new File( basedir, "output.txt").text +assert !(output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*\Q1.0\E/) + diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/.mvn/extensions.xml b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/.mvn/extensions.xml new file mode 100644 index 000000000..526b357f0 --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/.mvn/extensions.xml @@ -0,0 +1,10 @@ + + + + localhost + dummy-api + 1.0 + + \ No newline at end of file diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/invoker.properties b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/invoker.properties new file mode 100644 index 000000000..9e4e2c08f --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/invoker.properties @@ -0,0 +1,2 @@ +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates +invoker.mavenOpts = -Dversions.outputFile=./output.txt -DoutputEncoding=UTF-8 diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/pom.xml b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/pom.xml new file mode 100644 index 000000000..28820da69 --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + localhost + it-display-extension-updates-002 + + 1.0 + pom + + diff --git a/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/verify.groovy b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/verify.groovy new file mode 100644 index 000000000..42c1f5430 --- /dev/null +++ b/versions-maven-plugin/src/it/it-display-plugin-updates-issue-1184/verify.groovy @@ -0,0 +1,3 @@ +def output = new File( basedir, "output.txt").text +assert !(output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*\Q1.0\E/) + diff --git a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java index f48a72362..07801e08e 100644 --- a/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java +++ b/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java @@ -1002,6 +1002,8 @@ private static Stream getPluginManagementPlugins(BuildBase buildBase) { private static Stream getBuildPlugins(BuildBase buildBase, Map parentPluginManagement) { return buildBase.getPlugins().stream() + // apparently, core and build extensions are seen as plugins with a null goal, so let's filter them out + .filter(plugin -> plugin.getGoals() != null) // removing plugins without a version // and with the parent also not defining it for them .filter(plugin -> plugin.getVersion() != null || parentPluginManagement.get(plugin.getKey()) == null);