public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Taking Maven completely Off-Line
@ 2009-07-23  1:07 Alistair Bush
  0 siblings, 0 replies; only message in thread
From: Alistair Bush @ 2009-07-23  1:07 UTC (permalink / raw
  To: Gentoo Java

[-- Attachment #1: Type: text/plain, Size: 3278 bytes --]

>> This is a blantant copy and paste,  but I thought it might be
interesting, useful.


The other thing people talk alot about is other build tools that are better
than Ant, e.g. Gant, Raven <http://raven.rubyforge.org/> (ruby build scripts
for Java) or some other one I heard of recently – ah-ha! found it –
Gosling<https://gosling.dev.java.net/>(I’m sure I read a recent
article about it somewhere, that pointed to a
newer website?) that lets you write your build in Java and then just wraps
Ant! Bizzaro.

Another one is that people are concerned about their build tool changing
itself over time, and so their build is not necessarily stable and
reproducible. I for one love the idea of self upgrading software – hey, it’s
one step closer to the end of the
world<http://en.wikipedia.org/wiki/Skynet_%28fictional%29>right? Well
I for one welcome our build tool
overlords.<http://itre.cis.upenn.edu/%7Emyl/languagelog/archives/000399.html>But
seriously, I think that the advantage of having the build tool upgrade
itself and getting the latest bug fixes and feature updates, outweighs the
disadvantage of the build breaking one day. So what? – You take an hour out,
or half a day, or even a day, and fix it!

Buut, if you work in a stiff, rigid environment, or work for NASA or the
militar or something, then there’s a way around this as well. This is also
the suggested best practice for dealing with plugins. (O.k., I remember
reading this information somewhere, but it was harder to find again than i
thought.)

   1. Run mvn help:effective-pom -Doutput=effective.pom this produces a list
   of the plugin versions your project is currently using.
   2. Open effective.pom and copy the build->pluginManagement section into
   your pom, optionally deleting the configuration and just keeping the goupid,
   artifactid and version.
   3. Make sure your project packages, to test you got the pluginManagement
   right.
   4. Rename your local repository to repository.back
   5. Run mvn dependency:go-offline – this will download all plugins and
   their dependencies for your project, into a clean repository.
   6. Move the repository into  your project directory.
   7. Add the project repository to your POM as described above.
   8. Try running your mvn package with the –offline option and make sure
   everythings ok.
   9. Rename your backup from repository.bak back to repository.
   10. Commit.
   11. Done! You should be able to now build the project off of a fresh
   checkout and an empty repository.
   12. If you’ve gone this far, you may as well also commit the version of
   Maven your using into your source control as well, in a directory such as
   /tools/maven.

***

When MDEP-177 <http://jira.codehaus.org/browse/MDEP-177> is addressed, this
will be much easier to do.

On another note, as far as running off-line is concerned, the other really
neat-o thing you should definately do if there are more than two of you on
location (or if you’re keen to share snapshots easily), is setup a local
Maven repository cache/proxy/mirror using Nexus <http://nexus.sonatype.org/>.
IMO, don’t bother trying Artefactory or the other one, Nexus is da’ bomb.

Copied from http://stubbisms.wordpress.com/

[-- Attachment #2: Type: text/html, Size: 3444 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-23  1:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23  1:07 [gentoo-java] Taking Maven completely Off-Line Alistair Bush

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox