Skip to content

Commit 6b0d067

Browse files
committed
Allow a plugin defintion without configuration elements
1 parent caee992 commit 6b0d067

File tree

1 file changed

+1
-4
lines changed
  • maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/junit5

1 file changed

+1
-4
lines changed

maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/junit5/MojoExtension.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import org.apache.maven.plugin.descriptor.PluginDescriptor;
5555
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
5656
import org.apache.maven.plugin.logging.Log;
57-
import org.apache.maven.plugin.testing.ConfigurationException;
5857
import org.apache.maven.plugin.testing.MojoLogWrapper;
5958
import org.apache.maven.project.MavenProject;
6059
import org.codehaus.plexus.DefaultPlexusContainer;
@@ -333,9 +332,7 @@ public static Xpp3Dom extractPluginConfiguration(String artifactId, Xpp3Dom pomD
333332
.filter(e -> e.getChild("artifactId").getValue().equals(artifactId))
334333
.findFirst()
335334
.flatMap(buildElement -> child(buildElement, "configuration"))
336-
.orElseThrow(
337-
() -> new ConfigurationException("Cannot find a configuration element for a plugin with an "
338-
+ "artifactId of " + artifactId + "."));
335+
.orElse(Xpp3DomBuilder.build(new StringReader("<configuration/>")));
339336
return pluginConfigurationElement;
340337
}
341338

0 commit comments

Comments
 (0)