Hello all,
I already posted this question on ivy-users list but got no answer. Please, can
you help me with that?
I
have tried to repeat the example of using Ivy in multiple projects environment
similar to what is given in ivy tutorial
(http://ant.apache.org/ivy/history/2.1.0-rc1/tutorial/multiproject.html),
but with a small modification, but it did not work. I would like to ask you if
my changes should work and there is a bug in ivy or if I am doing something
wrong and should do it differently. So here you go.
I
have multi-project dir with two subdirectories representing two modules,
modules are named 'first' and 'second'. Where module second depends on artifact
produced by module 'first'. I have set build.xml, common/common.xml similar to
the tutorial.
'first'
artifact depends on public artifacts only:
<dependencies>
<dependency
org="commons-cli" name="commons-cli" rev="1.0"
conf="standalone->default"/>
</dependencies>
'second'
artifact depends on 'first' and public artifacts:
<dependencies>
<dependency
name="first" rev="1.0”
revConstraint='latest.integration'conf="core->default"/>
<dependency
org="commons-collections" name="commons-collections"
rev="3.1" conf="core->default" />
</dependencies>
here, as
you can see, is the difference from the tutorial. I want artifact 'second'
depend on 'first', but want to be flexible in the way of the actual version of
'first'. I want to be able to make changes to 'first' and build 'second' with
these changes, but, at the same time, if needed be able to build second with
official version of 'first'. To accomplish that I have two resolve targets set
<target
name="resolve" description="official artifacts">
<mkdir dir="${lib.dir}"/>
<ivy:resolve file="${ivy.file}"/>
<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" />
</target>
<target
name="integr-resolve" description="integration artifacts">
<mkdir dir="${lib.dir}"/>
<ivy:resolve file="${ivy.file}" resolveMode="dynamic"/>
<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" />
</target>
and two
publish targets:
<target
name="publish">
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
resolver="official" status=”release”
pubrevision="${version}"/>
</target>
<target
name="publish-integr">
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
resolver="intergr" status="integration"
pubrevision="${integr-version}"/>
</target>
where ${integr-version}
is build with ivy:buildnumber and ${version} is read from version.property.
So now
the problem I observe is that if I publish integration version of 'first'
locally with status='integration' and have official version of 'first' in the
repository
with status='release' ivy always picks up the official version. It looks like
ivy:resolve is ignoring the status of the published artifact it tries to
resolve, (well, at least I thought that ivy will look at the status and take it
into account).
I admit
that I may approach the problem in the wrong way and there is the right way to
do it, but that is what I came up with and would really appreciate any
suggestions on this mater.
Thank you.
Aleksey
Hotmail® has a new way to see what's up with your friends. Check it out.
_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009