Hello everyone,

Apologies if this is the wrong venue for this question. I'm trying to
retrieve the licenses for all the transitive dependencies for maven
projects. I'm currently using the MavenProject#getArtifacts() API and then
for each Artifact I am using the ProjectBuilder to build a Project from
each Artifact and retrieve the licenses from the Project.

I have two related questions:

(1) From debugging output I think that MavenProject#getArtifacts() returns
all versions of all artifacts. How do I retrieve the artifacts after
dependency mediation has been applied?

(2) Generating a Project from an Artifact is an expensive approach for me
since I only need the <licenses> information. I notice that my plugin
downloads a lot of jars. How do I generate a Model from an Artifact? The
license can be extracted from the Model.

Note that solving problem (1) makes problem (2) less of an issue, as extra
jars will no longer be downloaded.

Thanks,
--Michael

Reply via email to