From: Alistair Bush <alistair.bush@gmail.com>
To: Gentoo Java <gentoo-java@lists.gentoo.org>
Subject: [gentoo-java] Taking Maven completely Off-Line
Date: Thu, 23 Jul 2009 13:07:12 +1200 [thread overview]
Message-ID: <93e475bc0907221807h4e4346a3rc9a3160ca4425ca2@mail.gmail.com> (raw)
[-- 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 --]
reply other threads:[~2009-07-23 1:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93e475bc0907221807h4e4346a3rc9a3160ca4425ca2@mail.gmail.com \
--to=alistair.bush@gmail.com \
--cc=gentoo-java@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox