From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MTmmA-0007Np-KV for garchives@archives.gentoo.org; Thu, 23 Jul 2009 01:07:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9523FE01F8; Thu, 23 Jul 2009 01:07:13 +0000 (UTC) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.147]) by pigeon.gentoo.org (Postfix) with ESMTP id 66C61E01F8 for ; Thu, 23 Jul 2009 01:07:13 +0000 (UTC) Received: by qw-out-1920.google.com with SMTP id 4so321273qwk.10 for ; Wed, 22 Jul 2009 18:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ezyCR0Bc0rud9BCcWtxZLl9wjgD+34T/E478Wy1kexw=; b=vMCwIrStbH0wqyl4xcWhvt/wGOR4t6W6tNioDtvew4xKRGKU2PtRNDzaU8vmuULxrm Jc6XGyOZ3RpTHuizDTyAfDMVdAMDHMb1OrGS95S3UkbCfYPjJjSnwx/Jk0czD6xg+Vzt ptR16p4aqDGAvyoPJsPjU4gGQVrixgg8+F4jw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=SPj6j68p5XddMm143NePdFaxoff2meZxS3UgVStMcjDJIxjPExxUgkwO2nm3SuB8fR VGvD8ooTHvGmI8FrtlECwvVsV0E5o83Ksx6H3FytJn9RWKVEiZXYgHykB5sR5G/KxbGH EsW+2lzff5qe2ri83Azf3YfHf1SSin5h2Uab0= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@lists.gentoo.org MIME-Version: 1.0 Received: by 10.229.84.209 with SMTP id k17mr343186qcl.61.1248311233018; Wed, 22 Jul 2009 18:07:13 -0700 (PDT) Date: Thu, 23 Jul 2009 13:07:12 +1200 Message-ID: <93e475bc0907221807h4e4346a3rc9a3160ca4425ca2@mail.gmail.com> Subject: [gentoo-java] Taking Maven completely Off-Line From: Alistair Bush To: Gentoo Java Content-Type: multipart/alternative; boundary=0016364eef749d0082046f551b15 X-Archives-Salt: ef27bbec-f7f1-4e81-8775-46f82474a8a6 X-Archives-Hash: f3c3735654aaa7ebdcd1060f3f400282 --0016364eef749d0082046f551b15 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable >> 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 (ruby build script= s for Java) or some other one I heard of recently =96 ah-ha! found it =96 Gosling(I=92m 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 =96 hey, i= t=92s one step closer to the end of the worldright? Well I for one welcome our build tool overlords.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? =96 You take an hour o= ut, 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=92s a way around this as well. This is als= o 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=3Deffective.pom this produces a l= ist 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 gou= pid, 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 =96 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 =96offline 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=92ve gone this far, you may as well also commit the version o= f Maven your using into your source control as well, in a directory such a= s /tools/maven. *** When 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=92re keen to share snapshots easily), is setup a local Maven repository cache/proxy/mirror using Nexus . IMO, don=92t bother trying Artefactory or the other one, Nexus is da=92 bom= b. Copied from http://stubbisms.wordpress.com/ --0016364eef749d0082046f551b15 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

>> This is a blantant copy and paste,=A0 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 (ruby build scripts for Java) or so= me other one I heard of recently =96 ah-ha! found it =96 Gosling (I=92m 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 =96 hey, it=92s one step closer to the end of the world right? Well I for one welco= me our build tool overlords. 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? =96 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=92s 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=3Deffective.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 rep= ository to repository.back
  5. Run mvn dependency:go-offline =96 this w= ill download all plugins and their dependencies for your project, into a cl= ean repository.
  6. Move the repository into=A0 your project directory.
  7. Add the pro= ject repository to your POM as described above.
  8. Try running your mv= n package with the =96offline option and make sure everythings ok.
  9. Rename your backup from repository.bak back to repository.
  10. Commit.<= /li>
  11. Done! You should be able to now build the project off of a fresh ch= eckout and an empty repository.
  12. If you=92ve 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 i= s 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=92re keen to share snapshots easily), is setup a local Maven repository cache/proxy/mirror using Nexus. IMO, don=92t bother trying Artefactory or th= e other one, Nexus is da=92 bomb.


Copied from http://stubbisms.wordpress.com/
--0016364eef749d0082046f551b15--