Vonnahme, Paul wrote on 05/19/2009 01:26 PM:
I'm hoping someone else is in a similar situation. We have some
utility jars used by multiple projects. These jars have three
different versions: one each for our test, pilot, and production
environments. Therefore I believe each of the versions needs to be
published so it will be available for multiple apps to use.
When an app builds, it should get the latest version of the jar depending on
the environment. The ivy.xml would contain:
<dependency org="principal" name="utility_jar"
rev="latest.integration"/> .
I'd like to do something like:
ant compile -Denv=test
for it to build with the latest test jar, -Denv=pilot to build with the latest
pilot jar, etc.
My idea is to have three different versions of the settings file,
and just change the root of a resolver based on the environment.
<property name="ivy.shared.default.root"
value="/IvyRepository/test"/>
would specify the root of the 'shared' resolver for the test
environment. "/IvyRepository/pilot" would exist for pilot, etc.
Is there any reason not to use varying statuses for the different
environments?
http://ant.apache.org/ivy/history/trunk/settings/statuses.html
You could either use the default release/milestone/integration
statuses to map to your environments, or use your own.
In your ivy.xml,
<dependency org="principal" name="utility_jar"
rev="latest.${ivy.build.env}"/>
and run in test environment:
ant -Divy.build.env=integration compile
You can even default the property in ivysettings.xml, with an
override=false setting, to ensure your command-line param takes
precedence.
Now just publish your utility modules with the appropriate statuses,
and everything should Just Work, right?
Thanks,
----
Kirby Files
Software Architect
Masergy Communications
[email protected]