ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From imihov <imi...@linkedin.com>
Subject Inconsistent resolve behavior of dependencies with a classifier
Date Fri, 05 Jun 2009 01:56:14 GMT

We ran across this issue originally by using Ivy to read a POM and generate a
respective .ivy file. Rather than trying to explain the original setup, I
created a small test which demonstrates the problem.

The scenario consists of two artifacts where org.foo:foo:1.0.0 depends on
org:bar:bar:1.0.1, however, bar has a classifier. When doing a resolve with
an empty local cache, the resove fails as expected. However, subsequent
resolve attemps succeed and retrieve a local artifact which does not have
the classifier in it.

I understand that the .ivy file resulting from the POM conversion might not
be ideal with the 'artifact' element inside a dependency and that
configurations should be used instead. 

There are a couple of reasons for posting this:

 - Making sure we are not making a mistake in the ivysettings we have.

 - Seeking to understand the behavior where subsequent resolve succeeds
after an unsuccessful initial run.

 - Reporting a potential problem
 
 

[Ivy version]:
ivy-2.0.0.jar


[ivysettings.xml]:
<ivysettings>
  <settings defaultResolver="sandbox"/>
  <caches
defaultCacheDir="${user.home}/work/eclipse/work/ivy-classifier/ivy2-cache"
checkUpToDate="true" lockStrategy="artifact-lock"/>
  <resolvers>  
    <filesystem name="sandbox" m2compatible="true" local="true">
      <ivy
pattern="${user.home}/work/eclipse/workspace/ivy-classifier/sandbox-repo/[organisation]/[module]/[revision]/[module]-[revision].ivy"
/>
      <artifact
pattern="${user.home}/work/eclipse/workspace/ivy-classifier/sandbox-repo/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
    </filesystem>
  </resolvers>
</ivysettings>


[foo-1.0.0.ivy]:
<ivy-module 
  version="2.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:e="http://ant.apache.org/ivy/extra">
  
  <info organisation="org.foo" module="foo" revision="1.0.0"/>
  
  <configurations>
    <conf name="default" visibility="public" extends="master"/>
    <conf name="master" visibility="public" />
    <conf name="compile" visibility="public"/>
    <conf name="runtime" visibility="public"/>
  </configurations>
  
  <publications>
    <artifact name="foo" type="jar" conf="master"/>
  </publications>
  
  <dependencies>
    <dependency org="org.bar2" name="bar2" rev="1.0.1" force="true"
conf="compile->compile(*),master(*);runtime->runtime(*)">
	  <artifact name="bar2" type="jar" ext="jar" conf="" e:classifier="jdk15"/>
    </dependency>
  </dependencies>
</ivy-module>


[bar-1.0.1.ivy]:
<ivy-module 
  version="2.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:e="http://ant.apache.org/ivy/extra">
  
  <info organisation="org.bar2" module="bar2" revision="1.0.1"/>
  
  <configurations>
    <conf name="default" visibility="public" description="Default
configuration maps to master (the artifact itself)." extends="master"/>
    <conf name="master" visibility="public" description="Contains the
artifact published by this module itself, with no transitive dependencies"/>
    <conf name="source" visibility="public" description="Contains the source
artifact of this module, if any."/>
    <conf name="compile" visibility="public"/>
    <conf name="runtime" visibility="public"/>
  </configurations>
  
</ivy-module>

To see the problem:

 - expand the tar.gz
 - cd into work/eclipse/workspace/ivy-classifier
 - java -jar ivy-2.0.0.jar -settings ivysettings.xml -dependency org.foo foo
1.0.0 http://www.nabble.com/file/p23880837/ivy-classifier.tar.gz
ivy-classifier.tar.gz 
-- 
View this message in context: http://www.nabble.com/Inconsistent-resolve-behavior-of-dependencies-with-a-classifier-tp23880837p23880837.html
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message