Gentoo Archives: gentoo-java

From: Joshua Nichols <nichoj@g.o>
To: gentoo-java@l.g.o
Subject: [gentoo-java] ideas for packages which use maven to build
Date: Wed, 14 Dec 2005 17:06:28
Message-Id: 1134579920.4739.23.camel@francisco-repilado.nfic.com
1 I have been thinking recently, and I think I came up with a viable
2 solution for packaging this that use maven for building.
3
4 The first problem is that maven will attempt to download jar
5 dependencies from a remote repository. This can be avoided by calling
6 maven with -o, for offline mode.
7
8 This leads to the question of where, then, to get the jars from. I had
9 first thought at build time, we could populate a local repository with
10 symlinks to jars that we provide from packages. This would work, and
11 could be automated to some extent, but I think it would be tedious to
12 maintain a list of jars that each package needs.
13
14 So, today I came up with the idea of maintaining a package, like maven-
15 repo or something, that basically installs a local repository populated
16 with every jar from the repository... except they would actually be
17 symlinks to the jars provided by a package. For example:
18
19 /usr/share/maven-repo/commons-validator/jars/commons-validator-1.0.2.jar
20 --> /usr/share/commons-validator/lib/commons-validator.jar
21
22 This package would need a good amount of maintenance though, but I still
23 think it would be the simplest way to provide a maven repository for
24 building packages.
25
26 The next thing would be an eclass to support maven-built packages, like
27 java-maven.eclass perhaps. This would add a dependency of the most up-
28 to-date version of maven-repo (~dev-java/maven-repo), and a wrapper for
29 maven to force offline mode and to use our local repo
30 at /usr/share/maven-repo/, ie:
31
32 emaven() {
33 maven -Dmaven.repo.local=/usr/share/maven-repo -o "$@" || die "emaven
34 failed"
35 }
36
37 Additionally, it could do some sanity checks, by parsing the project.xml
38 and:
39 make sure that all of its dependencies are in /usr/share/maven-repo
40 make sure that the symlinks aren't broken, ie the package they point to
41 is installed
42 make sure the packages used in maven-repo are in DEPEND/RDEPEND
43
44
45
46 Once we have this framework in place, then we can also begin getting
47 maven built from source.
48
49
50 Regards,
51
52 Josh
53
54 --
55 gentoo-java@g.o mailing list

Replies

Subject Author
Re: [gentoo-java] ideas for packages which use maven to build Karl Trygve Kalleberg <karltk@g.o>
[gentoo-java] Re: ideas for packages which use maven to build "Jörg Schaible" <joerg.schaible@×××.de>