You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "maroschutte (via GitHub)" <gi...@apache.org> on 2026/07/16 06:49:18 UTC

[I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

maroschutte opened a new issue, #12497:
URL: https://github.com/apache/maven/issues/12497

   ### Affected version
   
   3.10.0-rc-1
   
   ### Bug description
   
   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on issue #12497:
URL: https://github.com/apache/maven/issues/12497#issuecomment-4995563549

   I see https://github.com/mojohaus/jaxws-maven-plugin/blob/e2535600a431a832b71e047755abfb35d66c3d5a/src/main/java/org/codehaus/mojo/jaxws/AbstractJaxwsMojo.java#L547
   
   ```java
         for ( Artifact a : pluginDescriptor.getArtifacts() )
         {
               addArtifactToCp( a, artifactsMap, endorsedArtifacts );
         }
   
   ...
   
       private void addArtifactToCp( Artifact a, Map<String, Artifact> artifactsMap, Set<Artifact> endorsedArtifacts )
       {
    ...
           else if ( "compile".equals( a.getScope() ) || "runtime".equals( a.getScope() ) )
           {
               artifactsMap.put( a.getGroupId() + ":" + a.getArtifactId(), a );
           }
       }
   ```
   
   so plugin dependencies with scope null is not added to ws class path


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on issue #12497:
URL: https://github.com/apache/maven/issues/12497#issuecomment-4995106307

   @maroschutte can you provide a simple project to reproduce issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

Posted by "maroschutte (via GitHub)" <gi...@apache.org>.
maroschutte commented on issue #12497:
URL: https://github.com/apache/maven/issues/12497#issuecomment-5000193130

   [maven-12497.zip](https://github.com/user-attachments/files/30114778/maven-12497.zip)
   
   This is a simple project that compiles fine with 3.9.16 and fails with 3.10.0-rc-1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski closed issue #12497: PluginDescriptor.getArtifacts() returns Artifact instances with null scope
URL: https://github.com/apache/maven/issues/12497


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] PluginDescriptor.getArtifacts() returns Artifact instances with null scope [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on issue #12497:
URL: https://github.com/apache/maven/issues/12497#issuecomment-4995496222

   Change introduced in 
    - https://github.com/apache/maven/pull/12327
   
   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 ....


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org