You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Alex Zhukov <al...@hotmail.com> on 2009/05/12 17:05:34 UTC
continues integration question
Hello All,
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="core->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,Alex
_________________________________________________________________
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
Re: Using a stand alone Ivy
Posted by Martin Eigenbrodt <ma...@googlemail.com>.
Hello,
I'm not very into the ivy code but from my experience and what I've read
here I try to answer:
>The main question is: is the Main.main(args) designed to deal with the ivy
from another
>java Program, or there is another way(s) ?
It is probably safer to invoke the ant tasks programmatically. They are more
often used and thus better tested than
invoking main
> When copying the retrieved add-on(always zip archives) in the local cache
directory, Ivy change the zip archive into jar >archive.
I think one needs a look at your ivysettings and the ivy.xml of the module
resolved to find the reason
> ... is a zip archive that may contain a description file
Normaly the ivy files are kept beside the artefacts (zips) but you might
beable to write a resolver being capable of extracting the ivy from the
zip.
Best regards,
Martin
2009/5/15 lemine youssef <yo...@nereide.biz>
> Hi evrebody;
>
> I' am telling my-self that my first message was not enough explained.
> The main question is: is the Main.main(args) designed to deal with the ivy
> from another
> java Program, or there is another way(s) ?
> Feel free to request further explanation, if you want to clarify some
> aspect this use case.
>
> Reagrds,
> Lemine Yousef.
>
> lemine youssef a écrit :
>
> Up ..
>>
>> Hi all,
>>
>>
>> We are working on a project for managing add-ons on the apache ofbiz
>> framework. an add-on is a specific functional or technical modifications,
>> provided as a set of patches.
>>
>> The add-ons-manager is designed to :
>> --> pack a collection of patches to form an add-on .
>> --> install and uninstall add-ons.
>> --> provide information on the installed add-ons for a given ofbiz
>> instance.
>>
>>
>> The add-ons will be kept in a public repository accessed using http:// in
>> the form of zip archives, and the use of an add-on may depends on one or
>> more add-ons. Our needs in terms of dependency management are, at least for
>> the moment, limited to : 1- Given an add-on name try to retrieve the latest
>> version from the repository, which is a zip archive that may contain a
>> description file (ivy.xml for example). all required dependencies declared
>> in that description file must be retrieved also. I started trying the use of
>> Ivy by the Use of the Main Class in side my addon-manager code(Main.main(new
>> String[]{"-setting","path to setting","-ivy","path to ivy.xml"})) and i have
>> the following notes : -I did modify the code to comment the System.exit(0)
>> because it terminates the JVM. -When copying the retrieved add-on(always zip
>> archives) in the local cache directory, Ivy change the zip archive into jar
>> archive.
>>
>> Qusetions :
>> -From your experience with Ivy, is it a good choice for this situation ?
>>
>> -am I using the Main in the good way, if yes how can i avoid the
>> termination of my JVM by ivy ?
>>
>> -can i invoke the resolve or retrieve process using the Main class?
>> -How to generate a report of dependencies using the main class always ?
>>
>>
>> Best regards
>>
>>
>>
>
>
Re: Using a stand alone Ivy
Posted by lemine youssef <yo...@nereide.biz>.
Hi evrebody;
I' am telling my-self that my first message was not enough explained.
The main question is: is the Main.main(args) designed to deal with the
ivy from another
java Program, or there is another way(s) ?
Feel free to request further explanation, if you want to clarify some
aspect this use case.
Reagrds,
Lemine Yousef.
lemine youssef a écrit :
> Up ..
>
> Hi all,
>
>
> We are working on a project for managing add-ons on the apache ofbiz
> framework. an add-on is a specific functional or technical
> modifications, provided as a set of patches.
>
> The add-ons-manager is designed to :
> --> pack a collection of patches to form an add-on .
> --> install and uninstall add-ons.
> --> provide information on the installed add-ons for a given ofbiz
> instance.
>
>
> The add-ons will be kept in a public repository accessed using http://
> in the form of zip archives, and the use of an add-on may depends on
> one or more add-ons. Our needs in terms of dependency management are,
> at least for the moment, limited to : 1- Given an add-on name try to
> retrieve the latest version from the repository, which is a zip
> archive that may contain a description file (ivy.xml for example). all
> required dependencies declared in that description file must be
> retrieved also. I started trying the use of Ivy by the Use of the Main
> Class in side my addon-manager code(Main.main(new
> String[]{"-setting","path to setting","-ivy","path to ivy.xml"})) and
> i have the following notes : -I did modify the code to comment the
> System.exit(0) because it terminates the JVM. -When copying the
> retrieved add-on(always zip archives) in the local cache directory,
> Ivy change the zip archive into jar archive.
>
> Qusetions :
> -From your experience with Ivy, is it a good choice for this situation ?
>
> -am I using the Main in the good way, if yes how can i avoid the
> termination of my JVM by ivy ?
>
> -can i invoke the resolve or retrieve process using the Main class?
> -How to generate a report of dependencies using the main class always ?
>
>
> Best regards
>
>
Re: Using a stand alone Ivy
Posted by lemine youssef <yo...@nereide.biz>.
Up ..
Hi all,
We are working on a project for managing add-ons on the apache ofbiz
framework. an add-on is a specific functional or technical
modifications, provided as a set of patches.
The add-ons-manager is designed to :
--> pack a collection of patches to form an add-on .
--> install and uninstall add-ons.
--> provide information on the installed add-ons for a given ofbiz instance.
The add-ons will be kept in a public repository accessed using http://
in the form of zip archives, and the use of an add-on may depends on one
or more add-ons. Our needs in terms of dependency management are, at
least for the moment, limited to : 1- Given an add-on name try to
retrieve the latest version from the repository, which is a zip archive
that may contain a description file (ivy.xml for example). all required
dependencies declared in that description file must be retrieved also. I
started trying the use of Ivy by the Use of the Main Class in side my
addon-manager code(Main.main(new String[]{"-setting","path to
setting","-ivy","path to ivy.xml"})) and i have the following notes : -I
did modify the code to comment the System.exit(0) because it terminates
the JVM. -When copying the retrieved add-on(always zip archives) in the
local cache directory, Ivy change the zip archive into jar archive.
Qusetions :
-From your experience with Ivy, is it a good choice for this situation ?
-am I using the Main in the good way, if yes how can i avoid the
termination of my JVM by ivy ?
-can i invoke the resolve or retrieve process using the Main class?
-How to generate a report of dependencies using the main class always ?
Best regards