Don't skip writing <artifact>s to ivy.xml even if there's only one.

Review Request #3388 - Created Jan. 28, 2016 and submitted

Information
Garrett Malmquist
pants
gmalmquist/emit-solitary-artifacts
2853
Reviewers
pants-reviews
nhoward_tw, patricklaw, zundel

We ran into a problem internally at Square where ivy would
stubbornly resolve a 'test-jar' instead of a 'jar' artifact, even
when we directly declared a dependency on the 'jar'. The reason for
this appears to be that pants was short-circuiting instead of
writing an explicit artifact for the 'jar'.

This changes:

   <dependency org="org.apache.hadoop"
                  name="hadoop-common"
                  rev="2.0.0-cdh4.6.0">
        <conf name="default" mapped="default"/>
        <\!-- excludes, etc -->
    </dependency>

To:

   <dependency org="org.apache.hadoop"
                  name="hadoop-common"
                  rev="2.0.0-cdh4.6.0">
        <conf name="default" mapped="default"/>
        <artifact
          name="hadoop-common"
          type="jar"/>
        <\!-- excludes, etc -->
    </dependency>

Which causes ivy to behave as expected.

This fixed our internal problem, and didn't break anything.

Manually confirmed that features like export --libraries-sources which have been historically fragile and prone to regression still work.

CI passed here: https://travis-ci.org/pantsbuild/pants/builds/105511558

Garrett Malmquist
Nick Howard (Twitter)
Eric Ayers
Garrett Malmquist
Review request changed

Status: Closed (submitted)

Change Summary:

In commit 29a10f706f3b4e6ea3d23413eab59f9a1b60838b, Thanks Nick and Eric!

Loading...