ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Buck, Robert" <rb...@verisign.com>
Subject RE: Are IVY Default Repositories Mandatory?
Date Wed, 01 Apr 2009 16:04:12 GMT
Alan and Sam,

Thank you so much!

Adding this definition to Ant resolved this:

    <pathconvert property="ivy.default.ivy.user.dir">
      <path location="${workspace.root}/ivy"/>
    </pathconvert>

And in combination with a "clobber" target that not only deletes build
artifacts but also deletes the ${workspace.root}/ivy directory entirely,
each workspace (multiple: release, instrumented) within a sandbox (all
sharing a common branch spec) can run entirely concurrently with respect
to one another. This change fixed my issues. Woohoo!

  <caches useOrigin="true"
resolutionCacheDir="${workspace.root}/ivy/cache/resolution"
repositoryCacheDir="${workspace.root}/ivy/cache/repository">
    <cache name="download-cache" lockStrategy="artifact-lock"
basedir="${sandbox.root}/ivy/cache/download" defaultTTL="0ms"/>
  </caches>

Are there any recommendations for properties such as defaultTTL (or
others I failed to set) that I should consider setting them to?

Again, thanks,

Bob

-----Original Message-----
From: Alan Chaney [mailto:alan@writingshow.com] 
Sent: Wednesday, April 01, 2009 11:04 AM
To: ivy-user@ant.apache.org
Subject: Re: Are IVY Default Repositories Mandatory?

Sam and Robert

Sam Berlin wrote:
> Robert, ...
>   
>
> On Wed, Apr 1, 2009 at 10:48 AM, Buck, Robert <rbuck@verisign.com>
wrote:
>
>   
>> Yes, the default cache is what I am stumbling over. I thought I took 
>> care of that by eliminating it entirely until I ran into a rather 
>> nasty little issue in the build environment when the default cache 
>> had references to older third-party libraries than my build area 
>> ivy.xml files referenced.
>>
>>     
Ok - I think that Sam's comments may be the relevant ones here. I've
never bothered to move my cache from the default location.  Your
original question was about the 'local' repository - presumably this is
now where you wanted it to be?

As a further comment to your point above the general problem with any
cache is knowing when to flush it! It may be that Sam's comments would
move the cache location properly. However, I have also found it
necessary to add a task to my ant build which allows me to flush the
cache and rebuild everything, which is often necessary after
modifications to the build structure or extensive changes to the build
files.

I seem to remember other discussions on this list about caching which it
might be good to look at.

Regards

Alan




>> If someone said, though shalt always use "local", then I'd be happy 
>> to tweak it so it exists in my build area rather than ${user.home}. 
>> But it was my expectation that we could define an entirely different 
>> set of repositories, caches, and resolvers and would never need to 
>> use "local", and nor would any artifacts be written to a location 
>> other than in my custom definitions.
>>
>> So how do I disable all use of the "local" by IVY?
>>
>> Here are my convoluted definitions and Ant use:
>>
>> <?xml version="1.0"?>
>> <ivysettings>
>>  <settings defaultResolver="default-chain"/>  <property 
>> name="ivy.volatile.repository"
>> value="${workspace.root}/ivy/repos/volatile" override="false"/>  
>> <property name="ivy.isolated.repository"
>> value="${sandbox.root}/ivy/repos/isolated" override="false"/>  
>> <caches useOrigin="true"
>> resolutionCacheDir="${workspace.root}/ivy/cache/resolution"
>> repositoryCacheDir="${workspace.root}/ivy/cache/repository">
>>    <cache name="download-cache" lockStrategy="artifact-lock"
>> basedir="${sandbox.root}/ivy/cache/download" defaultTTL="0ms"/>  
>> </caches>  <resolvers>
>>    <filesystem name="volatile-resolver">
>>      <ivy
>> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision
>> ]/i
>> vys/ivy-[revision].xml"/>
>>      <artifact
>> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision
>> ]/[
>> type]s/[artifact].[ext]"/>
>>      <artifact
>> pattern="${ivy.volatile.repository}/[organisation]/[module]/[revision
>> ]/[ type]s/[artifact]-[revision].[ext]"/>
>>    </filesystem>
>>    <filesystem name="isolated-resolver">
>>      <ivy
>> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision
>> ]/i
>> vys/ivy-[revision].xml"/>
>>      <artifact
>> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision
>> ]/[
>> type]s/[artifact].[ext]"/>
>>      <artifact
>> pattern="${ivy.isolated.repository}/[organisation]/[module]/[revision
>> ]/[ type]s/[artifact]-[revision].[ext]"/>
>>    </filesystem>
>>    <url name="download-resolver" cache="download-cache">
>>      <ivy
>> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revis
>> ion<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5B
>> revision>
>> ]/ivys/ivy-[revision].xml"/>
>>      <artifact
>> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revis
>> ion<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5B
>> revision>
>> ]/[type]s/[artifact].[ext]"/>
>>      <artifact
>> pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revis
>> ion<http://localhost:37373/ivyrep/%5Borganisation%5D/%5Bmodule%5D/%5B
>> revision> ]/[type]s/[artifact]-[revision].[ext]"/>
>>    </url>
>>    <chain name="default-chain" returnFirst="true">
>>      <resolver ref="volatile-resolver"/>  PUBLISH TO HERE LOCAL 
>> ARTIFACTS, IVYS, JARS, ETC
>>      <resolver ref="isolated-resolver"/>  WHERE "resolved-*.xml" and 
>> "resolved-*.properties" files go
>>      <resolver ref="download-resolver"/>  DOWNLOADS FROM SECURED 
>> VERISIGN IVYREP
>>    </chain>
>>  </resolvers>
>> </ivysettings>
>>
>>    <pathconvert property="ivy.default.ivy.user.dir">  <<< NASTY 
>> PROBLEM HERE, I THINK
>>      <path location="${user.home}/.ivy"/>
>>    </pathconvert>
>>    <pathconvert property="ivy.resolution.cache">
>>      <path location="${workspace.root}/ivy/cache/resolution"/>
>>    </pathconvert>
>>    <pathconvert property="ivy.repository.cache">
>>      <path location="${workspace.root}/ivy/cache/repository"/>
>>    </pathconvert>
>>    <pathconvert property="ivy.volatile.repos">
>>      <path location="${workspace.root}/ivy/repos/volatile"/>
>>    </pathconvert>
>>    <ivy:settings file="${ivy.default.conf.dir}/ivysettings.xml"/>
>>
>>  <target name="--buildmagic-ivy-retrieve"
>> depends="--buildmagic-ivy-init" unless="ivy.disable">
>>    <ivy:retrieve
>> pattern="${ivy.local.default.root}/[organisation]/[module]/[revision]
>> /[a
>> rtifact].[ext]"/>
>>  </target>
>>
>>  <target name="--buildmagic-ivy-resolve"
>> depends="--buildmagic-ivy-init,module-resolve"
>> unless="default.resolve.disable">
>>    <ivy:resolve file="${module.root}/build/ivy.xml"/>
>>    <ivy:cachepath pathid="cache.classpath"/>  </target>
>>
>>  <target name="--buildmagic-ivy-publish" depends="module-publish"
>> unless="default.publish.disable">
>>    <ivy:publish
>> artifactspattern="${module.output}/lib/[artifact].[ext]"
>> resolver="volatile-resolver" pubrevision="${version.number}"
>> overwrite="true"/>
>>  </target>
>>
>> -----Original Message-----
>> From: Alan Chaney [mailto:alan@writingshow.com]
>> Sent: Wednesday, April 01, 2009 10:28 AM
>> To: ivy-user@ant.apache.org
>> Subject: Re: Are IVY Default Repositories Mandatory?
>>
>> Hi Robert
>>
>> I don' think that they are mandatory - its just that the recommended 
>> 3 repository approach is what is pre-defined in the ivy settings in 
>> the ivy jar.
>>
>> I found the documentation quite confusing over this, and had to 
>> experiment a lot, but I have separate repositories defined outside of
>> ${user.home}/.ivy2
>>
>> Which repository you publish to or resolve from is entirely up to
you.
>> I've a set of repositories that I use for testing the dependency 
>> management and another one that I use for team work, and I select the

>> set of repositories by having a master property which chooses which 
>> one to use.
>>
>> Also, the default Ivy cache is in ${user.home}/.ivy2 - maybe that's 
>> what you are seeing (just a guess)
>>
>> Regards
>>
>> Alan Chaney
>>
>>
>>
>> Buck, Robert wrote:
>>     
>>> Good morning,
>>>
>>> The documentation states:
>>>
>>> "This default settings mainly consist of 3 kind of repositories...
>>> First, several repositories uses the same root in your filesystem.
>>> Referenced as ${ivy.default.ivy.user.dir}, this is by default the 
>>> directory .ivy2 in your user home."
>>>
>>> Is this to imply that the local, shared, and public repositories are

>>> mandatory?
>>>
>>> From my use it seems that local is mandatory since though I set up 
>>> my own custom resolvers, caches, and repositories, I still get stuff

>>> in ${user.home}.
>>>
>>> Bob
>>>
>>>
>>>
>>>
>>>
>>>       
>>     
>
>
> !DSPAM:49d38278289041381456296!
>
>   


Mime
View raw message