dev@glassfish.java.net

Re: Very unusual problem faced while doing build with maven

From: Craig L Russell <Craig.Russell_at_Sun.COM>
Date: Tue, 25 Mar 2008 09:31:12 -0700

Hi Sahoo,

Maven has two distinct phases when producing artifacts: the build
phase and the install phase. From your description, the jar was built
ok but not installed. If you run mvn jar:install in the project that
builds the jar, does it get copied to your local repo?

Maven goals that are single words are locally defined. It sounds like
the "install" goal doesn't actually jar:install the artifact. Look at
your project for the definition of install.

Craig

On Mar 25, 2008, at 4:14 AM, Sahoo wrote:

> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell_at_sun.com
P.S. A good JDO? O, Gasp!