dev@glassfish.java.net

Very unusual problem faced while doing build with maven

From: Sahoo <sahoo_at_sun.com>
Date: Tue, 25 Mar 2008 16:44:12 +0530

Today, I experienced something very unusual while using Maven. I can't
believe a build system like Maven behaves this way. I was firing a build
from v3 directory using 'mvn install' command, which includes two
modules called webtier and webtier-all in addition to many more modules.
Both the modules produce jar artifacts. Since webtier-all depends on
webtier module, maven started building webtier ahead of webtier-all.
webtier module produced the following jar file:

-rw-r--r-- 1 ss141213 staff 2104615 Mar 25 14:20
webtier-10.0-SNAPSHOT.jar

Later on, while building webtier-all module, I was very surprised to
notice that it was downloading webtier-10.0-SNAPSHOT.jar from remote
glassfish repo [1]. I am 100% sure of this, because of two reasons:
1) I had redirected the build output to a log file and the message
/"Downloading:
http://download.java.net/maven/glassfish/org/glassfish/web/webtier/10.0-SNAPSHOT/webtier-10.0-SNAPSHOT.jar"/
comes after webtier was built.
2) The signature of the jar in my local maven repo matches that of the
nightly binary that was posted in the remote repo as shown below:
diff
~/maven2rep/org/glassfish/web/webtier/10.0-SNAPSHOT/webtier-10.0-SNAPSHOT.jar.sha1
~/download/webtier-10.0-SNAPSHOT.jar.sha1

Eventually, although my build was successful, I ended up with a web.zip
and glassfish.zip which contained webtier.jar that's available in remote
repository and the webtier.jar that my local workspace had produced. I
have not seen this kind of behavior earlier. One thing to note is that
while I was doing a build, the glassfish repo was also updated, but the
jar in glassfish repo has a timestamp of 14:13 (after converting to IST)
was produced earlier than mine which has a timestamp of 14:20. That
confuses me even further. BTW, my workspace is up-to-date.

Thanks,
Sahoo