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 14:48:46 GMT
Alan, I appreciate your response. Can I ask one more question, while
providing a little bit more detail?


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.

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]/[revision
]/ivys/ivy-[revision].xml"/>
      <artifact
pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[revision
]/[type]s/[artifact].[ext]"/>
      <artifact
pattern="http://localhost:37373/ivyrep/[organisation]/[module]/[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:49d37936281076141877730!
>
>   


Mime
View raw message