1

Related question: Ivy cached a dependency file, but not copy to my lib

My situation is nearly identical, except that this has been working for quite a while until recently.

Ivy retrieves other jars: transitive dependencies like com.google.code.findbugs, and specified artifacts like junit.

It does not copy the guava jar to my lib.

ivy.xml:

<ivy-module version="2.0">
    <info organisation="mine" module="external-deps"/>
    <dependencies>
        <dependency org="com.google.guava" name="guava" rev="14.0.1"/>
        <dependency org="junit" name="junit" rev="4.11"/>
    </dependencies>
</ivy-module>

Ant retrieve task:

<target name="_ivy_retrieve" depends="init-ivy">
    <ivy:retrieve type="jar" pattern="${lib.dir}/ivy/[conf]/[organisation]/[artifact]-[type]-[revision].[ext]" log="quiet"/>
    <ivy:artifactproperty conf="default" name="lib.[artifact].[type]" value="ivy/[conf]/[organisation]/[artifact]-[type]-[revision].[ext]"/>
</target>

Is my ivy.xml specified incorrectly? Is my retrieve task broken? Or, did something break for the 14.0.1 distribution for Guava?

Community
  • 1
  • 1
justinpitts
  • 721
  • 8
  • 11

2 Answers2

3

It appears that Ivy's type attribute strongly corresponds to Maven's packaging attribute. Google Guava uses package type bundle instead of jar which is used by most open source projects.

Ref: http://search.maven.org/#artifactdetails%7Ccom.google.guava%7Cguava%7C17.0%7Cbundle

kevinarpe
  • 20,319
  • 26
  • 127
  • 154
  • Thanks. This helped me as well. I changed the type from 'jar' to 'jar,bundle' and now it works. – Franklin Jul 08 '14 at 13:18
  • Note that this problem relates to [IVY-633](https://issues.apache.org/jira/browse/IVY-633), which was first resolved back in June 2008 for Ivy 2.0, but the resolution is incomplete and ineffective. – javabrett Sep 25 '15 at 07:07
  • See also my answer on [this post](http://stackoverflow.com/questions/16491229/ivy-cached-a-dependency-file-but-not-copy-to-my-lib). – javabrett Sep 25 '15 at 12:46
2

The

type="jar"

attribute was causing the issue. Removing this corrects the problem.

justinpitts
  • 721
  • 8
  • 11