On Mon, Jul 6, 2009 at 5:03 PM, mavenusr<[email protected]> wrote:
>
> Thanks. Yes. My property files aren't part of the JAR.
>
> so again my question is, if i change the property files, will the JAR
> automically pickup the change without the need for rebuilding it?
No. If none of the files that make up your jar file are changed, the
jar file simply isn't rebuilt. Maven is really extremely good at this.
Much better than Ant.
However, if you build an assembly (that is you package that jar file
with your properties files in a tarball or a zipfile), the assembly
will be rebuilt! I mention this because I explained how to build an
assembly back in my reply to you on June 26.
That makes perfect sense. Jar file isn't rebuilt because none of the
files in it are changed. Assembly flie is rebuilt because the
properties file in it was changed.
Now, by default, Maven doesn't build assemblies on the package
lifecycle -- only the jar flie. So, by default, if you do:
$ mvn package
And, you changed your properties file, but nothing else, the "mvn
package" won't do anything except print out a lot of garbage.
If you changed your properties file, but not any of the files that
make up the jar, and you do this:
$ mvn assembly:assembly
The assembly will be rebuilt. The jar file won't be, but a new
assembly tarball or zip file will be rebuilt.
The only reason I'm mentioning this is that you can change Maven's
default behavior by telling Maven to build the assembly on the package
lifecycle step. Again, I mentioned how to do this in my June 26 reply
to you.
Therefore, if you changed your pom.xml file to build your assembly on
the package stage of your development lifecycle, doing this:
$ mvn package
Will do something: It won't rebuild your jar file, but it will rebuild
your assembly.
--
David Weintraub
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]