@podenski:
> Maven produces snapshots (work in progress) that are inherently not the released version of software.
Only if you append "-SNAPSHOT" to the version number in the POM. From
my understanding of Maven, snapshot version numbers aren't meant for
end products, they're for when you are developing a dependency
simultaneously with the product. For example you might have a library
whose POM looks like this:
<project ...>
...
<artifactId>my-library</artifactId>
<version>2.5-SNAPSHOT</version>
...
</project>
And a product that depends on it whose POM looks like this:
<project ...>
...
<artifactId>my-product</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>...</groupId>
<artifactId>my-library</artifactId>
<version>2.5-SNAPSHOT</version>
</dependency>
</dependencies>
...
</project>
The benefit of this setup is that developers working on "my-product"
will always be using the most recently deployed version of "my-
library". Whereas if the library had a static version number like
"2.5", Maven would look in its local repo and say "yep, I already have
2.5, so I won't download 2.5 from the remote repo".
However you don't want to release my-product with any snapshot
dependencies in it, otherwise you're never going to know which of
those snapshots was the one that allowed the product to pass
successfully through the deployment pipeline. So I'd suggest that
builds not be allowed to progress into the expensive part of the
pipeline (e.g. anything requiring human testers) until all the
snapshot dependencies have been replaced with released versions.
Another approach would be to avoid snapshots altogether and just
accept that my-library might have a rapidly increasing version number
(because the demands being placed on it by my-product might still be
evolving). In most cases that won't matter, because the customer won't
know or care about dependency versions, whereas product version
numbers can be subject to all sorts of marketing considerations.
Anyway, I'm experimenting with doing CD using Maven and Hudson, and
what I have set up so far is this:
1. Commit Stage: a Hudson job runs "mvn clean install" on each commit
2. Automated Acceptance Test Stage: another Hudson job downstream of
the first runs "mvn verify", which for my test web app sets up an
embedded Jetty server via Cargo, deploys the built WAR file to it,
runs some JWebUnit tests via the application's URLs (using JUnit), and
shuts down Jetty (again, via Cargo)
The bit that's missing now is that the deployment to the automated
test environment is done by Maven rather than by a repeatable
deployment "script" as recommended by the book. For example, the QA
team couldn't use "mvn verify" to pull a new instance for manual QA.
I'm working on that bit next.
I haven't used the Maven release plugin, but I'm leery about using
anything that will modify an artifact that's already passed QA. Since
each commit represents a release candidate, why not just give the
product its final intended version number in the POM (e.g. 1.0) and
identify the various RCs by their VCS revision number (assuming you're
using a VCS like SVN (and not CVS) whose revision numbers are at least
product-wide)?