Gentoo Archives: gentoo-java

From: "Jörg Schaible" <joerg.schaible@×××.de>
To: gentoo-java@l.g.o
Subject: [gentoo-java] Re: Re: Maven from source - version 2.x or 3.x ?
Date: Thu, 26 May 2011 16:07:12
Message-Id: irltpn$nh3$1@dough.gmane.org
In Reply to: Re: [gentoo-java] Re: Maven from source - version 2.x or 3.x ? by Robert Burrell Donkin
1 Robert Burrell Donkin wrote:
2
3 > On Wed, May 25, 2011 at 5:09 PM, Jörg Schaible
4 > <joerg.schaible@×××.de> wrote:
5 >> Hi Robert,
6 >
7 > Hi Jörg
8 >
9 >> Robert Burrell Donkin wrote:
10 >
11 > <snip>
12 >
13 >>> maven seems to be moving towards requiring specific core versions for
14 >>> builds. some projects i develop require maven 2, some maven 3. i
15 >>> manage this situation with a set of custom scripts and installations
16 >>> independent of gentoo. i expect other developers now work in a similar
17 >>> way. (same goes for jdks.) the gentoo java stuff just gets in my way
18 >>> now for development.
19 >>
20 >> Why? I have emerged maven:1.0, maven:1.1, maven:2.0, maven:2.2 and
21 >> maven:3.0. I've selected my default version with eselect. However, I can
22 >> use any of those versions at the same time:
23 >>
24 >> /usr/bin $ ls -lGgo m*v*n*
25 >> lrwxrwxrwx 1 34 Jan 22 14:07 maven-1.0 -> /usr/share/maven-
26 >> bin-1.0/bin/maven
27 >> lrwxrwxrwx 1 34 Jan 22 14:07 maven-1.1 -> /usr/share/maven-
28 >> bin-1.1/bin/maven
29 >> lrwxrwxrwx 1 7 Jul 19 2010 mvn -> mvn-3.0
30 >> lrwxrwxrwx 1 32 Apr 30 2010 mvn-2.0 ->
31 >> /usr/share/maven-bin-2.0/bin/mvn lrwxrwxrwx 1 32 Apr 30 2010 mvn-2.2
32 >> -> /usr/share/maven-bin-2.2/bin/mvn lrwxrwxrwx 1 32 Mar 10 18:17
33 >> mvn-3.0 -> /usr/share/maven-bin-3.0/bin/mvn
34 >>
35 >> All that eselect effectively does is to switch the unversioned link. You
36 >> may call any of those scripts (well, you should not have set MAVEN_HOME
37 >> at all, the Maven start script will do this for you anyway).
38 >
39 > eselect edits the symlinks. this switches the maven version for the
40 > entire system. i want to be able to switch maven (and ant and java)
41 > versions for just a terminal. is there some way to make this work with
42 > eselect?
43
44 Defining aliases? Or use prepend a terminal specific directory to the path
45 where you define your own symlinks.
46
47 export PATH=~/tmp/term-1:$PATH
48 ls ~/tmp/term-1
49 mvn -> /usr/bin/mvn-2.2
50 jar -> /usr/lib/jvm/sun-jdk-1.6/bin/jar
51 java -> /usr/lib/jvm/sun-jdk-1.6/bin/java
52 javac -> /usr/lib/jvm/sun-jdk-1.6/bin/javac
53 javah -> /usr/lib/jvm/sun-jdk-1.6/bin/javah
54
55 For Ant you might create your own slotted ebuilds (maybe as ant-bin to
56 separate from the one provided with Gentoo) and use symlinks again.
57
58 I am quite sure you can create a little helper script that sets up such
59 links for the current terminal when you provide the version for those
60 packages as argument.
61
62 Cheers,
63 Jörg