Gentoo Archives: gentoo-soc

From: Kasun Gajasinghe <kasunbg@×××××.com>
To: gentoo-soc@l.g.o
Cc: kiorky <kiorky@××××××××××.net>, Serkan Kaba <serkan@g.o>, Alistair Bush <ali_bush@g.o>
Subject: [gentoo-soc] Gentoo Maven Integration - Weekly Report #10
Date: Sun, 07 Aug 2011 18:16:23
Message-Id: CADg9GQb_DATNCjeL0QZii+av3eKbwbmhoHVvC=mcXmeKfoo6eg@mail.gmail.com
1 Hi all,
2 -----------------Goal-----------------
3 The goal of this project is to be easily able to write ebuilds for
4 upstream projects that use Apache Maven as the build system. The Maven
5 integration allows to natively use Apache Maven in Java packages in
6 the main tree. The current system work around the support for Maven
7 projects by transforming them to Ant. It generates build.xml via “mvn
8 ant:ant” command and sanitizes that. This conversion too has some
9 problems and needs to fixed. With this project, developers gains the
10 ability to use native Maven support for writing ebuilds and will get
11 full support for using maven-to-ant feature.
12
13 -----------------Progress-----------------
14 Last week has been spent on the java-maven-2 eclass as well as on pom
15 rewriting. The eclass is responsible for invoking maven for packaging
16 the maven-based builds, and installing the artifacts. There were few
17 additions to the eclass, but not very large scale. Written
18 documentation for the eclass.
19 In the mean time, I've been looking at the remaining plugins including
20 maven-surefire-plugin, and fixing the configuration bits. Right now,
21 all the basic plugins required are up and running for simple projects.
22 There is several compatibility issues I've been facing these days when
23 it comes to maven's approach of building vs Gentoo build system. So,
24 some parts of the week has been spent on getting know the internals of
25 maven better. I've discussed with the maven community in mailing list
26 as well as irc for some insights. Some outcomes though sounded sweet,
27 but turned out misleading later on.
28
29 Two major issues I had was these. First, the issue with specifying the
30 maven plugin versions. Maven plugins are installed separately of maven
31 package. mvn needs the plugin versions to operate correctly. The
32 versions need to match the installed plugins in Gentoo. Discussion at
33 [1] was regarding this at Maven dev list. That was apart from the
34 discussions I had with mentor. Two suggested solutions (settings.xml
35 and plugin-registry.xml thing) turned out impossible after spending
36 valuable time on them. The remaining solution is not an ideal
37 solution, but we got to settle for it. Basically, the current idea is
38 to have a Gentoo maven super pom, that will override the
39 maven-super-pom and have the set of installed plugin versions
40 specified. This will continue in this week.
41
42 Second issue, was maven's enormous number of parent poms with
43 packaging 'pom'. Most of these are identical to each other, and
44 doesn't need to be/ can't be installed. So, we needed to have a
45 mechanism to have more control over the parent pom of a given project.
46 This has been implemented currently. Changed the pom rewriter as well
47 the eclass to conform to this. The controlling happens via
48 "MAVEN_PARENTPOM_UNIQUE_ID" and "MAVEN_REWRITE_PARENT_OF_SUBMODULES"
49 (=Y/N) variables. The format is -
50 MAVEN_PARENTPOM_UNIQUE_ID="parentGroupId:parentArtifactId:parentVersion"
51 or just "parentVersion". MAVEN_REWRITE_PARENT_OF_SUBMODULES tells
52 whether to rewrite the parent-element of sub-modules as well.
53 maven-plugins-by-ant-2.2.1 is a sample ebuild for this [3].
54
55 [1] http://maven.40175.n5.nabble.com/Set-specific-plugin-versions-for-a-project-issue-in-plugin-registry-xml-maven-metada-local-xml-td4629803.html
56 [2] http://maven.40175.n5.nabble.com/surefire-api-not-relocating-the-classes-of-commons-lang-though-it-s-in-m-shade-p-config-td4658872.html#none
57 [3] http://overlays.gentoo.org/proj/java/browser/gsoc-maven-overlay/dev-java/maven-plugins-by-ant/maven-plugins-by-ant-2.2.1.ebuild?rev=8679
58
59 Thanks,
60 --Kasun
61
62 --
63 ~~~*******'''''''''''''*******~~~
64 Kasun Gajasinghe,
65 University of Moratuwa,
66 Sri Lanka.
67 Blog: http://blog.kasunbg.org
68 Twitter: http://twitter.com/kasunbg