Accessing java.net maven repository from Ivy
Ivy is an increasingly popular dependency management tool. It lets your (Ant) build script downloads library jars from other places, much like Maven. The part that I like about Ivy is that it doesn't try to be everything, unlike Maven. Since I just wasted almost 3 hours trying to get the maven-assembly-plugin to create a convenient all-in-one JAX-WS commons bundle (and in the end blocked by this silly bug), I decided to try Ivy.
Ivy comes out-of-the-box with an implementation that lets you pull jar files from any Maven2 repository, so all the artifacts of our java.net M2 repository are available to the Ivy users. But unfortunately, there's no code to support our java.net Maven1 repository. This is quite unfortunate, as our Maven1 repository hosts a lot of interesteing Sun jars that are not available elsewhere.
So I created one to solve the problem, which brings me to the main point of this post. What this little jar enables you to do is to pick up artifacts from the java.net Maven1 repository, and use its POMs to resolve transitive dependencies automatically. You can download the jar from the link above.
To use this, you'll first create ivysettings.xml (in your project) and define where the repositories are. The following example uses the java.net M1/2 repo and ibiblio, in a sequential fashion (so if an artifact you are looking for is available in any one of those places, you'll be OK)
This is a sample ivy.xml file that describes the dependencies. The stax-ex dependency is actually a transitive dependency from the JAX-WS RI jar, but due to a bug in the stax-ex 1.0 POM, I had to set explicit dependency to 1.1.
And now here is the build script that shows how to hook this up all together. When you run it, you'll get all the transitive dependencies of the JAX-WS RI 2.1.1 in the lib directory.
If you are interested, the complete example is available. This is my first exposure to Ivy, so if I'm doing things in a wrong/redundant way, please let me know.