Gentoo Archives: gentoo-java

From: "Jörg Schaible" <joerg.schaible@×××.de>
To: gentoo-java@l.g.o
Subject: [gentoo-java] Re: [mvn-intg] maven-from-source : An issue when invoking mvn
Date: Wed, 29 Jun 2011 21:17:12
Message-Id: iug4mi$avh$1@dough.gmane.org
In Reply to: [gentoo-java] [mvn-intg] maven-from-source : An issue when invoking mvn by Kasun Gajasinghe
1 Hi Kasun,
2
3 Kasun Gajasinghe wrote:
4
5 > Hi,
6 > After bumping more than 50 ebuilds, we were finally able to bump maven
7 > package itself. But there's few issues to get over with.
8 >
9 > Following error occurs when mvn-2.2 is invoked. As you probably
10 > already know, maven uses classworlds-1.1 for class loading. Further,
11 > upstream uses uberjar, which packages all the dependencies together.
12 > We have circumvented the need for having an uberjar by creating
13 > symlinks of needed jars under the directory /usr/share/maven-2.2/lib/.
14 >
15 > As I see, it fails before getting in to maven through classworlds.
16 > Unfortunately, I haven't have much experience with of classworlds
17 > behaves. Does anyone of you have any idea to get rid of this error?
18 > This _may_ not be an issue of maven having an incorrect classpath.
19 >
20 > If this is through, we'll be much closer to getting maven from source
21 > working.
22 >
23 > $ mvn-2.2 -X
24 > + Error stacktraces are turned on.
25 > Apache Maven 2.2.1 (r1135082; 2011-06-26 09:41:29+0530)
26 > Java version: 1.6.0_25
27 > Java home: /opt/sun-jdk-1.6.0.25/jre
28 > Default locale: en_US, platform encoding: ANSI_X3.4-1968
29 > OS name: "linux" version: "2.6.36-gentoo-r8" arch: "i386" Family: "unix"
30 > org.codehaus.classworlds.NoSuchRealmException: plexus.core
31 > at org.codehaus.classworlds.ClassWorld.getRealm(ClassWorld.java:128)
32 > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:434)
33 > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
34
35
36 Did you try this without symlinks, just for test?
37
38
39 > Maven is called via classworlds with the command:
40 > "${JAVACMD}" \
41 > $MAVEN_OPTS \
42 > -classpath $(java-config -p classworlds-1.1) \
43 > -Dclassworlds.conf=/usr/share/maven-2/maven_home/bin/m2.conf \ #the m2.
44 > -Dmaven.home=/usr/share/maven-2.2 \
45 > -Dmaven.repo.remote=${HOME}/.m2/repository \
46 > -Dmaven.repo.local=${HOME}/.m2/repository \
47 > ${CLASSWORLDS_LAUNCHER} \
48 > ${@}
49 >
50 > (The full script:
51 > http://overlays.gentoo.org/proj/java/browser/gsoc-maven-overlay/dev-
52 java/maven/files/2.2.1/bin/mvn)
53
54 Explain __MAVENHOME__ and __MAVEN_SHARE__.
55
56 I am also wondering about:
57
58 > -Dmaven.repo.remote=${HOME}/.m2/repository \
59 > -Dmaven.repo.local=${HOME}/.m2/repository \
60
61 Note, that the format of the meta data in a remote and a local repo
62 *differs*. AFAICS you cannot have both at the same location. Why not have
63 one single system-wide remote repo, that is "stuffed" with the Gentoo-
64 installed libraries only? Simply add that to
65 /usr/share/maven-2.2/conf/settings.xml in an always active profile named
66 e.g. "gentoo-system".
67
68 >
69 > And, m2.conf file looks like this:
70 > =======
71 > main is org.apache.maven.cli.compat.CompatibleMain from plexus.core
72 >
73 > set maven.home default ${user.home}/m2
74 >
75 > [plexus.core]
76 > load ${maven.home}/lib/*.jar
77 > ========
78 >
79 > Let me know if any more information is needed
80
81 Maybe it's simply stupid?
82
83 $ file /usr/share/maven-bin-2.2/bin/m2.conf
84 /usr/share/maven-bin-2.2/bin/m2.conf: ASCII text, with CRLF line terminators
85
86 - Jörg

Replies