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 Richard_Senior <ri...@gmail.com> on 2011/03/22 16:21:38 UTC
Just the artifacts...
Hello,
This is my first 'modular' build and I've discovered Ivy.. which I
immediately like.
I'm trying to replace my existing build scripts which do what Ivy does
manually using the ant get task.
What I want to do is simply get all the dependancy jars into my /lib folder
but I'm getting all the source jars and ivy files too.
What do I do so that retrieve simply gets the jars I want, into the folder I
want, and nothing else?
These are my settings (censored) :
<ivysettings>
<settings defaultCache="local" defaultResolver="resolvers"/>
<caches defaultCacheDir="${lib.dir}">
<cache name="local" basedir="${lib.dir}">
<ttl duration="0d" />
</cache>
</caches>
<resolvers>
<chain name="resolvers" returnFirst="true">
<filesystem name="workspace">
<artifact
pattern="${workspace.dir}/[organisation]/build/dist/live/[artifact].[revision].[ext]"/>
</filesystem>
<url name="cruisecontrol">
<artifact
pattern="http:/xxxx:8080/artifacts/[organisation]/[branch]/live/[artifact].[revision].[ext]"
/>
</url>
<url name="com.springsource.repository.bundles.release">
<ivy
pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
<artifact
pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
</url>
<url name="com.springsource.repository.bundles.external">
<ivy
pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
<artifact
pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
</url>
</chain>
</resolvers>
</ivysettings>
<ivy-module version="2.0">
<info organisation="xxx" module="${ant.project.name}" />
<dependencies>
<!-- buildtime dependancies -->
<dependency org="org.apache.ant"
name="com.springsource.org.apache.tools.ant" rev="1.8.1" />
<dependency org="com.springsource.bundlor"
name="com.springsource.bundlor" rev="1.0.0.RELEASE"/>
<dependency org="com.springsource.bundlor"
name="com.springsource.bundlor.blint" rev="1.0.0.RELEASE" />
<dependency org="com.springsource.bundlor"
name="com.springsource.bundlor.commandline" rev="1.0.0.RELEASE" />
<dependency org="com.springsource.bundlor"
name="com.springsource.bundlor.ant" rev="1.0.0.RELEASE" />
<dependency org="org.objectweb.asm"
name="com.springsource.org.objectweb.asm" rev="3.2.0" />
<dependency org="org.objectweb.asm"
name="com.springsource.org.objectweb.asm.commons" rev="3.2.0" />
<dependency org="com.springsource.util"
name="com.springsource.util.common" rev="2.0.0.RELEASE" />
<dependency org="com.springsource.util"
name="com.springsource.util.math" rev="2.0.0.RELEASE" />
<dependency org="com.springsource.util"
name="com.springsource.util.osgi" rev="2.0.0.RELEASE" />
<dependency org="com.springsource.util"
name="com.springsource.util.parser.manifest" rev="2.0.0.RELEASE" />
<dependency org="org.junit" name="com.springsource.org.junit"
rev="4.8.1" />
<!-- runtime dependancies -->
<dependency org="com.thoughtworks.xstream"
name="com.springsource.com.thoughtworks.xstream" rev="1.3.1" />
<!-- aka stax -->
<dependency org="javax.xml.stream"
name="com.springsource.javax.xml.stream" rev="1.0.1" />
<!-- original open source version of ehcache, not teracotta version -->
<dependency org="net.sourceforge.ehcache"
name="com.springsource.net.sf.ehcache" rev="1.6.2" />
<dependency org="org.aopalliance"
name="com.springsource.org.aopalliance" rev="1.0.0" />
<dependency org="org.apache.commons"
name="com.springsource.org.apache.commons.codec" rev="1.4.0" />
<dependency org="org.apache.commons"
name="com.springsource.org.apache.commons.httpclient" rev="3.1.0" />
<dependency org="org.apache.commons"
name="com.springsource.org.apache.commons.lang" rev="2.5.0" />
<dependency org="org.apache.commons"
name="com.springsource.org.apache.commons.logging" rev="1.1.1" />
<dependency org="org.apache.log4j"
name="com.springsource.org.apache.log4j" rev="1.2.16" />
<dependency org="org.codehaus.jettison"
name="com.springsource.org.codehaus.jettison" rev="1.0.1" />
<!-- try to get something out of cruise -->
<dependency org="core" name="xxx" rev="1.0.0" branch="20110318160503" />
</dependencies>
</ivy-module>
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211016.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Steve Miller-26 wrote:
>
> <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]"
> conf="runtime" type="jar"/>
> Make sure you clear the lib dir. Or add sync="true". It should work the
> same in version 2 as well.
>
No, it's still not giving me things in the pattern you show above. I'm
getting the default
[organisation]/[module]/[type]s/[artifact]-[revision].[ext] style pattern
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211283.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Steve Miller <th...@gmail.com>.
<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]"
conf="runtime" type="jar"/>
Make sure you clear the lib dir. Or add sync="true". It should work the same
in version 2 as well.
On Tue, Mar 22, 2011 at 11:32 AM, Richard_Senior
<ri...@gmail.com>wrote:
>
>
> Steve Miller-26 wrote:
> >
> > Try <ivy:retrieve ... type="jar"/>
> >
>
> Thanks for the quick response!
>
> Still not working.. it's putting everything in ./lib in the full repository
> structure of [org].... complete with all ivy's.
>
> I think there's a thing called ivyPattern and artifactPattern you can use
> in
> the cache settings but I've tried that and that doesn't work either!
>
> Build script as follows :
>
> <?xml version="1.0"?>
> <project name="core" default="build" basedir="."
> xmlns:bundlor="antlib:com.springsource.bundlor.ant"
> xmlns:ivy="antlib:org.apache.ivy.ant">
> <property name="workspace.dir" location="../"/>
> <property name="lib.dir" location="./lib"/>
> <property name="lib.dir.buildtime" location="${lib.dir}/buildtime"/>
> <property name="lib.dir.buildtime.ivy"
> location="${lib.dir.buildtime}/ivy"/>
> <property name="ivy.version" value="2.0.0-beta1"/>
>
> <target name="build" depends="ivy_bootstrap" />
>
> <target name="ivy_bootstrap">
> <mkdir dir="${lib.dir.buildtime.ivy}"/>
> <echo message="getting ivy from maven repository"/>
> <get
> src="
> http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar
> "
> dest="${lib.dir.buildtime.ivy}" usetimestamp="true"/>
> <path id="ivy.lib.path">
> <fileset dir="${lib.dir.buildtime.ivy}"
> includes="*.jar"/>
> </path>
> <taskdef resource="org/apache/ivy/ant/antlib.xml"
> uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
> <ivy:retrieve type="jar"/>
> </target>
>
> </project>
>
> --
> View this message in context:
> http://old.nabble.com/Just-the-artifacts...-tp31211016p31211108.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Nope, still not working even with the latest version of Ivy
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211194.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Actually could it just be that I seem to be using an old version of ivy?
I'm using 2 instead of 2.2
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211160.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Steve Miller-26 wrote:
>
> Try <ivy:retrieve ... type="jar"/>
>
Thanks for the quick response!
Still not working.. it's putting everything in ./lib in the full repository
structure of [org].... complete with all ivy's.
I think there's a thing called ivyPattern and artifactPattern you can use in
the cache settings but I've tried that and that doesn't work either!
Build script as follows :
<?xml version="1.0"?>
<project name="core" default="build" basedir="."
xmlns:bundlor="antlib:com.springsource.bundlor.ant"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="workspace.dir" location="../"/>
<property name="lib.dir" location="./lib"/>
<property name="lib.dir.buildtime" location="${lib.dir}/buildtime"/>
<property name="lib.dir.buildtime.ivy"
location="${lib.dir.buildtime}/ivy"/>
<property name="ivy.version" value="2.0.0-beta1"/>
<target name="build" depends="ivy_bootstrap" />
<target name="ivy_bootstrap">
<mkdir dir="${lib.dir.buildtime.ivy}"/>
<echo message="getting ivy from maven repository"/>
<get
src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
dest="${lib.dir.buildtime.ivy}" usetimestamp="true"/>
<path id="ivy.lib.path">
<fileset dir="${lib.dir.buildtime.ivy}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:retrieve type="jar"/>
</target>
</project>
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211108.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Steve Miller <th...@gmail.com>.
Try <ivy:retrieve ... type="jar"/>
On Tue, Mar 22, 2011 at 11:21 AM, Richard_Senior
<ri...@gmail.com>wrote:
>
> Hello,
>
> This is my first 'modular' build and I've discovered Ivy.. which I
> immediately like.
> I'm trying to replace my existing build scripts which do what Ivy does
> manually using the ant get task.
> What I want to do is simply get all the dependancy jars into my /lib folder
> but I'm getting all the source jars and ivy files too.
> What do I do so that retrieve simply gets the jars I want, into the folder
> I
> want, and nothing else?
>
> These are my settings (censored) :
>
> <ivysettings>
> <settings defaultCache="local" defaultResolver="resolvers"/>
>
> <caches defaultCacheDir="${lib.dir}">
> <cache name="local" basedir="${lib.dir}">
> <ttl duration="0d" />
> </cache>
> </caches>
>
> <resolvers>
> <chain name="resolvers" returnFirst="true">
> <filesystem name="workspace">
> <artifact
>
> pattern="${workspace.dir}/[organisation]/build/dist/live/[artifact].[revision].[ext]"/>
> </filesystem>
>
> <url name="cruisecontrol">
> <artifact
>
> pattern="http:/xxxx:8080/artifacts/[organisation]/[branch]/live/[artifact].[revision].[ext]"
> />
> </url>
>
> <url
> name="com.springsource.repository.bundles.release">
> <ivy
> pattern="
> http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
> "
> />
> <artifact
> pattern="
> http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
> "
> />
> </url>
>
> <url
> name="com.springsource.repository.bundles.external">
> <ivy
> pattern="
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
> "
> />
> <artifact
> pattern="
> http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
> "
> />
> </url>
> </chain>
> </resolvers>
> </ivysettings>
>
>
>
> <ivy-module version="2.0">
> <info organisation="xxx" module="${ant.project.name}" />
> <dependencies>
> <!-- buildtime dependancies -->
> <dependency org="org.apache.ant"
> name="com.springsource.org.apache.tools.ant" rev="1.8.1" />
>
> <dependency org="com.springsource.bundlor"
> name="com.springsource.bundlor" rev="1.0.0.RELEASE"/>
> <dependency org="com.springsource.bundlor"
> name="com.springsource.bundlor.blint" rev="1.0.0.RELEASE" />
> <dependency org="com.springsource.bundlor"
> name="com.springsource.bundlor.commandline" rev="1.0.0.RELEASE" />
> <dependency org="com.springsource.bundlor"
> name="com.springsource.bundlor.ant" rev="1.0.0.RELEASE" />
>
> <dependency org="org.objectweb.asm"
> name="com.springsource.org.objectweb.asm" rev="3.2.0" />
> <dependency org="org.objectweb.asm"
> name="com.springsource.org.objectweb.asm.commons" rev="3.2.0" />
>
> <dependency org="com.springsource.util"
> name="com.springsource.util.common" rev="2.0.0.RELEASE" />
> <dependency org="com.springsource.util"
> name="com.springsource.util.math" rev="2.0.0.RELEASE" />
> <dependency org="com.springsource.util"
> name="com.springsource.util.osgi" rev="2.0.0.RELEASE" />
> <dependency org="com.springsource.util"
> name="com.springsource.util.parser.manifest" rev="2.0.0.RELEASE" />
>
> <dependency org="org.junit" name="com.springsource.org.junit"
> rev="4.8.1" />
> <!-- runtime dependancies -->
> <dependency org="com.thoughtworks.xstream"
> name="com.springsource.com.thoughtworks.xstream" rev="1.3.1" />
> <!-- aka stax -->
> <dependency org="javax.xml.stream"
> name="com.springsource.javax.xml.stream" rev="1.0.1" />
> <!-- original open source version of ehcache, not teracotta
> version -->
>
> <dependency org="net.sourceforge.ehcache"
> name="com.springsource.net.sf.ehcache" rev="1.6.2" />
> <dependency org="org.aopalliance"
> name="com.springsource.org.aopalliance" rev="1.0.0" />
>
> <dependency org="org.apache.commons"
> name="com.springsource.org.apache.commons.codec" rev="1.4.0" />
> <dependency org="org.apache.commons"
> name="com.springsource.org.apache.commons.httpclient" rev="3.1.0" />
> <dependency org="org.apache.commons"
> name="com.springsource.org.apache.commons.lang" rev="2.5.0" />
> <dependency org="org.apache.commons"
> name="com.springsource.org.apache.commons.logging" rev="1.1.1" />
>
> <dependency org="org.apache.log4j"
> name="com.springsource.org.apache.log4j" rev="1.2.16" />
> <dependency org="org.codehaus.jettison"
> name="com.springsource.org.codehaus.jettison" rev="1.0.1" />
>
> <!-- try to get something out of cruise -->
> <dependency org="core" name="xxx" rev="1.0.0"
> branch="20110318160503" />
> </dependencies>
> </ivy-module>
>
> --
> View this message in context:
> http://old.nabble.com/Just-the-artifacts...-tp31211016p31211016.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Ok all.. It's fixed.
My problems were :
1) Wrong version of Ivy
2) My Cache dir was my lib dir
3) I didn't wait until the end of the build when there is quite obviously a
'copy' task that puts all the artifacts in lib.
Thanks all for your time.
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211570.html
Sent from the ivy-user mailing list archive at Nabble.com.
Re: Just the artifacts...
Posted by Richard_Senior <ri...@gmail.com>.
Maarten Coene wrote:
>
> Are you sure you are looking in your lib dir and not in your ivy-cache
> dir?
> Maarten
>
They are the same dir... is this a problem?
--
View this message in context: http://old.nabble.com/Just-the-artifacts...-tp31211016p31211503.html
Sent from the ivy-user mailing list archive at Nabble.com.