On 15.07.2010 10:12, Michael Richter wrote:
On 15 July 2010 15:57, Vladimir Ritz Bossicard
<[email protected]>wrote:

Michael,

  I can't seem to find some way to
have Ivy use a repository whose location might change from invocation to
invocation.  The problem is that depending on the physical configuration
my
Ivy installation (and attendant repository) might be on a

I solved a similar problem by adding placeholders in the ivyconf.xml file:

<filesystem name="localrepo" checkmodified="true">
<artifact
pattern="${localrepo.dir}/[organisation]/[module]/[revision]/conf/[artifact].[ext]"
/>
<artifact
pattern="${localrepo.dir}/[organisation]/[module]/[revision]/lib/[artifact]-[revision].[ext]"
/>
<artifact
pattern="${localrepo.dir}/[organisation]/[module]/[revision]/lib/[artifact].[ext]"
/>
</filesystem>

with ${localrepo.dir} simply being an Ant property.

The problem here being that the localrepo will change from machine to
machine as I move the USB stick.
[I assume that your project's code will be somewhere on the machine and only the localrepo on the USB stick].

To solve this, you can have a build-local.properties files that stores "local" Ant properties (this file is local to the checked-out project and not checked into your Subversion). Typically, I have:

    build.xml
    build.properties (checked in)
    build-local.properties (not checked in)

the ${localrepo.dir} is defined in the build-local.properties file only.

If the code and the repo are on the stick, I would rather have some <copy> target from renaming some build-local-host1.properties (or build-local-host2.properties) into build-local.properties before each ivy retrieval.

hth

-Vladimir

Reply via email to