maven3 enforces the good practice of using timestamped snapshots (by dropping
support for uniqueVersion=false) so I had no choice but to try and get it to
work, even though I was just fine with non-unique snapshots.

My project setup is pretty typical: projectA depends on projectB which
depends on projectC. Then the pom for projectA includes the classpath in the
manifest of the jar (maven-jar-plugin 2.3.1) and builds a distribution
(maven-assembly-plugin 2.2.1) which copies all jars (A, B, C) to a lib
directory.

Now, when all projects have a SNAPSHOT version and I try to build a
distribution for projectA, here's what happens:

1. The classpath in the manifest of the projectA jar contains:
 - projectB-version-timestamp.jar
 - projectC-version-timestamp.jar

Fine so far, timestamped snapshots are used.

2. The lib directory from the distribution (built by the assembly plugin)
contains:
 - projectB-version-timestamp.jar
 - projectC-version-SNAPSHOT.jar

Now this is a problem! The classpath contains the timestamped jar while the
name in the assembly is -SNAPSHOT. And only for the indirect dependency
projectC.

Note: I am aware that I can configure the jar plugin to not use the
timestamp and configure the assembly plugin to do an outputFileMapping and
drop the timestamp. However, I think that it should all work out of the box.
If the general philosophy in maven3 is to impose the timestamped versions
then maven-core along with the basic plugins should all be consistent and
use the timstamped SNAPSHOT versions for all dependencies without extra
tweaking.

However, even if the inconsistency above is fixed, I would still have
projectA-version-SNAPSHOT.jar in the distribution while the dependencies B
and C are timestamped. This is because projectA was built locally while
projects B and C were downloaded from the repository. It does look like this
functionality was not thought out all the way and I wish the maven team kept
the unique snapshots for those that preferred that approach.




--
View this message in context: 
http://maven.40175.n5.nabble.com/Inconsistent-handling-of-timestamped-snapshots-in-maven3-tp4625067p4625067.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to