Posts Tagged ivy

JRuby Rake and Ivy

Here’s a neat way of using ivy with jruby, rake & ant.

task :ivy_retrieve do
  ant.taskdef :resource => "org/apache/ivy/ant/antlib.xml" do
    classpath :location => "ivy/ivy-2.2.0.jar"
  end
  ant.configure :file => "ivy/ivysettings.xml"
  ant.resolve :file => "ivy/ivy.xml"
  ant.retrieve :pattern => "lib/[conf]/[type]/[artifact]-[revision].[ext]", :sync => "true"
  puts
end

Still using ant, still angle bracket free (except for ivy, sigh). Read my previous post if you want to know more about jruby, rake and ant.

Tags: , , , , , ,

Spring-StringTemplate is now in Maven Central

For Ivy:

<dependency org="com.watchitlater" name="spring-stringtemplate" rev="1.5.1" />

For Maven (yeech):

<dependency>
  <groupId>com.watchitlater</groupId>
  <artifactId>spring-stringtemplate</artifactId>
  <version>1.5.1</version>
</dependency>

Thank you Sonatype.

Tags: , , , , ,

Apache Ivy and Spring EBR

Here is how I set up the Apache Ivy dependency manager so that it can fetch springframework JARs from the SpringSource Enterprise Bundle Repository.

Listing: ivysettings-custom.xml

<ivysettings>
    <resolvers>
        <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 name="spring">
            <resolver ref="com.springsource.repository.bundles.release"/>
            <resolver ref="com.springsource.repository.bundles.external"/>
        </chain>
        <ibiblio name="jboss" root="http://repository.jboss.org/maven2/" m2compatible="true"/>
        <chain name="main" dual="true">
            <resolver ref="shared" />
            <resolver ref="public" />
            <resolver ref="spring" />
            <resolver ref="jboss" />
        </chain>
        <chain name="default" returnFirst="true">
            <resolver ref="local" />
            <resolver ref="main" />
        </chain>
    </resolvers>
</ivysettings>

Listing: ivysettings.xml

<ivysettings>
    <settings defaultResolver="default" />
    <include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
    <include file="ivysettings-custom.xml" />
</ivysettings>

This means that dependencies such as:

<dependency org="org.springframework" name="org.springframework.web.servlet" rev="3.0.2.RELEASE" />

should now be resolved correctly from the EBR.

Tags: , , , ,