Ivy and Sun’s Java.net Maven repo

I want to use Sun’s Java.net Maven repo with Ivy, and this is not documented well anywhere.

In ivysettings.xml (Ivy will automatically use it) put:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ivysettings>
<ivysettings>
  <settings defaultResolver="chained" />
  <property name="java.net.maven.pattern"
    value="[organisation]/jars/[module]-[revision].[ext]" />
  <resolvers>
    <chain name="chained" returnFirst="true">
      <ibiblio name="ibiblio" m2compatible="true" />
      <ibiblio name="java-net-maven2"
        root="http://download.java.net/maven/2/"
        m2compatible="true" />
      <ibiblio name="java-net-maven1"
        root="http://download.java.net/maven/1/"
        pattern="${java.net.maven.pattern}"
        m2compatible="false" />
    </chain>
  </resolvers>
</ivysettings>

Now you can make an ivy.xml with dependencies like <dependency org="com.sun.grizzly" name="grizzly-http" rev="2.0.0-SNAPSHOT"/> and have it work right.

Written by
Open Source software architect and technologist. He's just this guy, you know? Follow him him on Google+.
Published in
Transmissions from the Little Blue Marble

Published September 24th, 2009

Comments

One Response
Leave a Reply