With Eclipse Aether I can read a pom and gather information in the
form of import org.eclipse.aether.graph.Dependency and
Is there some way from these or related objects I can gather the
information about the packaging of the dependency? That is, the type
child element of the dependency element in the original pom.xml file?
I seem to be able to get the extension of the file, but that's not
quite the same thing.
On Fri, Sep 21, 2018 at 3:21 AM, <[hidden email]> wrote:
> a dependency has a type, but not really a packaging: a packaging is a recipe to build a project that will produce multiple artifacts, each with its own type
> see the comparison 
> and default artifact handlers  gives you informations about default types.
I'm not really using Maven core. I have my own Java code that does
things Maven doesn't do. It relies on Aether to parse the pom.xml
files. I could just parse XML directly, but Aether handles property
resolution, artifact resolution, parent POMs, BOMs, finding repos, and
a lot of other Maven specific details I'd otherwise have to reinvent.
The POM I'm struggling with now looks like this:
I'm not trying to package, just read the value of the type element out
of the pom.xml. That is, the pom.xml contains dependencies like this:
Since Aether doesn't report the type element in the dependency, so far
as I can tell, my code ends up with duplicates and no way to
I'm not totally clear on why this pom.xml (google-cloud-bom if
anyone's interested) includes test-jar types. If anyone can make a
strong argument that these should not be there in the first place, I
may be able to get them removed though I don't own this code. However,
in the meantime I do need to distinguish the first
dependency from the second.