You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PluginDescriptor.getArtifacts() returns Artifact instances with null scope #12497
When testing maven 3.10.0-rc-1 I found that the org.codehaus.mojo:jaxws-maven-plugin didn't work any longer.
Debugging this problem, I found that the org.apache.maven.plugin.descriptor.PluginDescriptor.getArtifacts() method now returns org.apache.maven.artifact.Artifact instances that return 'null' on their getScope() method. In maven 3.9.16 (and all versions before) the actual scope was returned (for instance "compile" or "runtime").
As far as I can tell this is a bug/regression on maven 3.10 which is possibly introduced by the introduction of resolver version 2
In class maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
In 3.9.x we created list of plugin artifacts based on DependencyNode,
now we use DependencyResult#getArtifactResults and convert to Maven artifacts by org.apache.maven.RepositoryUtils#toArtifact(org.eclipse.aether.artifact.Artifact), so scope is lost ....
Activity
slawekjaranowski commentedon Jul 16, 2026
@maroschutte can you provide a simple project to reproduce issue?
slawekjaranowski commentedon Jul 16, 2026
Change introduced in
In class
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.javaIn 3.9.x we created list of plugin artifacts based on
DependencyNode,now we use
DependencyResult#getArtifactResultsand convert to Maven artifacts byorg.apache.maven.RepositoryUtils#toArtifact(org.eclipse.aether.artifact.Artifact), so scope is lost ....slawekjaranowski commentedon Jul 16, 2026
I see https://github.com/mojohaus/jaxws-maven-plugin/blob/e2535600a431a832b71e047755abfb35d66c3d5a/src/main/java/org/codehaus/mojo/jaxws/AbstractJaxwsMojo.java#L547
so plugin dependencies with scope null is not added to ws class path
maroschutte commentedon Jul 17, 2026
maven-12497.zip
This is a simple project that compiles fine with 3.9.16 and fails with 3.10.0-rc-1
Preserve dependency scope in plugin artifacts
Preserve dependency scope in plugin artifacts
Preserve dependency scope in plugin artifacts