Hi all,

in a Maven Plugin project, we need to obtain all elements of the runtime 
classpath during the *compile* phase. The code is currently calling 
`project.getRuntimeClasspathElements()`. That in turn iterates over 
`MavenProject.getArtifacts()` which is documented to only return elements of a 
certain scope:

/**
 * All dependencies that this project has, including transitive ones. Contents 
are lazily populated, so depending on
 * what phases have run dependencies in some scopes won't be included. eg. if 
only compile phase has run,
 * dependencies with scope test won't be included.
 */

IIUC, that means that during the compile phase, runtime dependencies will not 
be returned, which makes me wonder why `….getRuntimeClasspathElements()` uses 
that obviously limited method in the first place because depending on the phase 
you call the method in you'll never actually be able to see the runtime 
elements.

Should the method augment the set of artifacts resolved with the runtime scoped 
ones held in `ModuleProject.dependencyArtifacts`?

Cheers,
Ollie

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to