April 2005
[ Brett ] 23:30, Monday, 25 April 2005

The Maven team have released a set of Ant tasks for performing dependency management within your Ant scripts. This includes:

  • Transitive dependencies
  • Snapshot handling
  • Scope tracking
  • Deployment using SCP, SFTP, and file protocols

The tasks are based on the Maven 2.0 artifact handling code, so behave identically. The version included is slightly newer, from the upcoming alpha-2 release.

This gives you access to the more than 8500 artifacts available in the Maven central repository, and the ability to utilise the published artifacts from other Maven 1.0 or Maven 2.0 built applications.

An example use:

<artifact:dependencies pathId="dependency.classpath">
<dependency groupId="org.apache.maven.wagon" artifactId="wagon-provider-test" version="1.0-alpha-2"/>
</artifact:dependencies>

Download: http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-artifact-ant-2.0-alpha-1-dep.jar
User's guide: http://maven.apache.org/maven2/ant-tasks.html

[ Brett ] 16:22, Thursday, 14 April 2005

Snapshots were something that I believed to be widely misunderstood in Maven 1.0, and this was because they tended to have a dual purpose.

I believe it is now a lot closer to the original intention.

Snapshots as Dependencies

From ther POM writer's perspective using a development library, a dependency always contains SNAPSHOT (eg 2.0-SNAPSHOT). However, snapshots are now deployed to the remote server as numbered versions, never as just the single filename. Repository metadata is used to store the timestamp and build number of the artifact, so that when the project resolves the SNAPSHOT reference, it gets the latest version. This version can later be stored in the POM to ensure a reproducible build, and a user can compare what version they have to the repository version to check if they are the same or not.

A big complaint was the frequency of download checks on SNAPSHOTs which can be quite slow - it would happen multiple times within a single Maven instance in some occasions. Maven 2.0 has improved on that - not only is it only checked once per Maven execution, the default is to only check once a day. Of course, the interval is configurable from the POM, and there is also a command line option to force it to check every Maven run as well. This can make it much like CVS updates: just update your dependencies when you are ready to integrate with everyone else.

Developing with Snapshots

For those building the SNAPSHOTs, it is also simpler. You specify something like 2.0-SNAPSHOT in your <version/> tag (meaning you are working towards 2.0). This need only be changed at the point of release. Installation and deployment takes care of putting it in the right place - there is only one install and one deploy goal, no need to remember to deploy it as a snapshot like in Maven 1.x. Also, it is saved as a single file in the local repository, so you can develop freely without cluttering up your disk (as local installs occur a lot more frequently than remote builds).

How it all works

Vincent has spoken before about binary dependencies and how they are useful. Maven 2.0's snapshot handling should make this option a lot more palatable.

There is still more work to do to be able to make different versions interact together, but we're well on the way.

For those interested, the original design for SNAPSHOT handling in Maven 2.0 is available.

[ Brett ] 03:35, Saturday, 9 April 2005

The first Maven 2.0 Technology Preview release is now out.

http://maven.apache.org/maven2/index.html

We're looking forward to hearing your feedback, ideas, and (to a lesser extent :) bug reports.

If you need help with the release, please consult the documentation frequently as we continue to update it, and subscribe to the users@maven.apache.org mailing list. For more information, please see http://maven.apache.org/maven2/about.html#get-help

We welcome contributors to the Maven project - if you are interested in helping out, please see http://maven.apache.org/maven2/about.html#get-involved

Thanks to everyone who has worked on this release!

-- The Apache Maven Team