Resolving SNAPSHOT dependencies with timestamps from Ivy

Ivy supports resolving timestamped snapshots, but with the following limitation: the specified pattern on your ibiblio resolver must end with: [organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext] This is not the case in your setup, so Ivy won’t try to find your timestamped snapshot. Updating your pattern to this one should solve your problem; update the definition of your archiva-snapshots repository … Read more

Where do I put my credentials when using Ivy and a private company repository?

Use a settings file with properties controlling the Nexus credentials: <ivysettings> <property name=”repo.host” value=”default.mycompany.com” override=”false”/> <property name=”repo.realm” value=”Sonatype Nexus Repository Manager” override=”false”/> <property name=”repo.user” value=”deployment” override=”false”/> <property name=”repo.pass” value=”deployment123″ override=”false”/> <credentials host=”${repo.host}” realm=”${repo.realm}” username=”${repo.user}” passwd=”${repo.pass}”/> .. .. </ivysettings> When you run the build you can then specify the true username and password: ant -Drepo.user=mark -Drepo.pass=s3Cret … Read more

sample example which explain how to use filesystem resolver

The ivysettings.xml file is located by default in the same directory as the ivy.xml file. Alternative locations can be specified using the ivy settings task Project structure 3rd party dependencies located in the lib directory. $ tree . |– build.xml |– ivysettings.xml |– ivy.xml |– lib | |– junit-4.10.jar | |– slf4j-api-1.6.4.jar | `– slf4j-simple-1.6.4.jar … Read more

How to avoid copying dependencies with Ivy

Here’s my standard Java build file that creates an executable jar. The objective is to manage project specific stuff via a combination of ANT properties and an ivy.xml file for the 3rd-party dependencies. <project xmlns:ivy=”antlib:org.apache.ivy.ant” name=”demo” default=”build”> <property name=”src.dir” location=”src”/> <property name=”build.dir” location=”build”/> <property name=”dist.dir” location=”dist”/> <property name=”dist.jar” location=”${dist.dir}/${ant.project.name}.jar”/> <property name=”dist.main.class” value=”HelloWorld”/> <target name=”retrieve”> <ivy:resolve/> … Read more

Use public maven repository with ivy

You need to add an ivysettings.xml file with the following repositories listed (resolvers in ivy speak) <ivysettings> <settings defaultResolver=”chain”/> <resolvers> <chain name=”chain”> <ibiblio name=”central” m2compatible=”true”/> <ibiblio name=”example” m2compatible=”true” root=”http://example.com/m2/”/> </chain> </resolvers> </ivysettings> In my opinion it makes more sense to separate the dependency declaration (ivy.xml) from the mechanism of retrieval (settings.xml). This is not needed … Read more

Ivy, what is the master configuration and why is it not pulling jvyaml?

I would suggest restructuring your configurations as follows: <ivy-module version=”2.0″> <info organisation=”com.myspotontheweb” module=”demo”/> <configurations> <conf name=”compile” description=”Libraries needed only for compilation” /> <conf name=”runtime” description=”Libraries only needed at runtime” extends=”compile” /> <conf name=”test” description=”Libraries only needed for testing” extends=”runtime” /> </configurations> <dependencies> <dependency org=”net.java.dev” name=”jvyaml” rev=”0.2.1″ conf=”runtime->default” /> <dependency org=”org.apache.solr” name=”solr-core” rev=”3.6.0″ conf=”runtime->default” /> </dependencies> … Read more