On Fri, Sep 21, 2018 at 3:21 AM,  <[email protected]> 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 [1]
>
> and default artifact handlers [2] 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:

<project>>
...
  <dependencyManagement>
    <dependencies>
 ...
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bigtable</artifactId>
        <version>0.62.1-alpha-SNAPSHOT</version><!--
{x-version-update:google-cloud-bigtable:current} -->
      </dependency>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bigtable</artifactId>
        <version>0.62.1-alpha-SNAPSHOT</version><!--
{x-version-update:google-cloud-bigtable:current} -->
        <type>test-jar</type>
      </dependency>
 ...
    </dependencies>
  </dependencyManagement>

</project>


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
distinguish them.

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.

-- 
Elliotte Rusty Harold
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to