Yes,

result.getPaths().stream().map(Path::toString).collect(Collectors.joining(":"))

Usually, I would assume the plugin needs to also concat with the
target/classes and target/test-classes as done in the compiler plugin:
https://github.com/gnodet/maven-compiler-plugin/blob/m-api/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java#L339-L362


Le mar. 19 déc. 2023 à 13:13, Tamás Cservenák <ta...@cservenak.net> a
écrit :

> Howdy,
>
> I think this is it, no? Guillaume?
>
> https://github.com/apache/maven/blob/master/api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyResolverResult.java#L40
>
> Basically you need to concat paths (using OS path separator) to get
> classpath....
>
> Maybe we want this on API as well, as even Resolver 1.x did publish this:
>
> https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.18/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java#L130
>
>
> Thanks
> T
>
> On Tue, Dec 19, 2023 at 1:08 PM Martin Desruisseaux <
> martin.desruisse...@geomatys.com> wrote:
>
> > Le 2023-12-19 à 11 h 36, Guillaume Nodet a écrit :
> > >
> > > Ideally, you'd only focus on org.apache.maven.api.* and forget about
> > > everything else. That's the Maven 4 API and all other things are not
> > > part of that API (including MavenProject). The class path resolution
> > > should be done using the following code:
> > >
> > > (…snip…)
> > > for (Dependency dependency : result.getDependencies().keySet()) {
> > >    DependencyProperties properties =
> > dependency.getDependencyProperties();
> > >    ...
> > > }
> >
> > Thanks, I will adapt the code proposal. But above example gets only the
> > list of dependencies. Is there is central place in Maven 4 API for doing
> > the next step, which is to build the class-path, etc. from this set, or
> > is it expected that each plugin would do this work themselves? In the
> > latter case, I would like to replace this assumption by an API doing
> > this work for plugins. Plugins would not be forced to use that API, but
> > encouraged.
> >
> >      Martin
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > For additional commands, e-mail: dev-h...@maven.apache.org
> >
> >
>


-- 
------------------------
Guillaume Nodet

Reply via email to