[PATCH] Add maven-build-system.

OpenSubmitted by Julien Lepiller.
Details
One participant
  • Julien Lepiller
Owner
unassigned
Severity
normal
J
J
Julien Lepiller wrote on 28 Jun 03:41 +0200
(address . guix-patches@gnu.org)
20200628034135.2c7b9d9b@tachikoma.lepiller.eu
Hi Guix!
This patch series adds the maven-build-system, at last! You can findthe patches on the wip-maven-build-system branch of my repository, athttps://framagit.org/tyreunom/guix/-/tree/wip-maven-build-system
I haven't sent the patches on this mailing because there are ~100 ofthem. If you prefer, I'll send the series with git send-patch.
Here is a summary of the changes:
guix: java-utils: Add Maven-related phases.
This patch adds some functionalities to guix/build/java-utils.scm, inparticular the install-from-pom and install-pom-file functions that arephases you can use instead of the install phase. As their namesuggests, they install a package from a pom.xml file to a mavenrepository directory structure in lib/m2. install-pom-file onlyinstalls a single pom.xml file, instead of the file and its jar.
gnu: java-asm: Remove dependency on bnd libraries....gnu: java-jarjar: unbundle maven-plugin-api.
This small series of patches improves the bootstrap of java-junit bynot relying on bundled libraries (binaries), by enabling tests in junitand by reducing the number of dependencies that must be built beforejunit. Junit is now fully bootstrapped.
gnu: java-junit: Install from pom file.
This patch converts junit and its dependencies to the maven repositorystructure. It also takes care of changing junit's dependents that had ahardcoded path to the junit jar file.
gnu: Add apache-parent-pom-13....gnu: Add maven-components-parent-pom-21.
This series adds many parent pom packages to a new file,maven-parent-pom.scm. A parent pom is a single pom.xml file thatcontains information about a project. Actual packages can thenreference these files to inherit some or all of these information.
gnu: java-commons-lang3: Update to 3.9....gnu: maven: Install from pom file.
These patches update some dependencies of maven and the maven buildsystem, and convert them so they are installed in the maven repositorystructure.
gnu: maven-shared-utils: Fix /bin/sh invocation.gnu: java-modello-core: Propagate inputs.
These two patches implement fixes that are required later on.
gnu: Add java-plexus-digest....gnu: Add maven-jar-plugin.
This patch series adds more packages that are maven plugins or theirdependencies. Maven doesn't do anything by itself, it's simply adependency/lifecycle manager. It requires plugins to actually dothings such as compiling, creating a jar archive, installing, testing,etc... This is what these patches implement.
guix: Add maven-build-system.
The actual commit that adds the maven-build-system :)
In the end, the maven-build-system only has the very basic plugins bydefault, but it is able to compile, test and install a simple helloworld example application, generated by maven (see test.scm attached).
Next step is building the maven-plugin-plugin, which is the plugin thatbuilds other plugins. Currently the plugins are built with a customplugin.xml generator that uses a buggy java parser, so I don't want torely on it for other plugins. Note that we can't use themaven-plugin-plugin to build any of the current plugins, since they areneeded to build themselves...
I also noticed that our maven is acting weird wrt lifecycles: it seemsto be doing some test-related work during the build step, and rebuildsin the test and install steps. This is weird, but I'm not sure how tofix. Re-building maven with the maven-build-system might give as abetter version of maven. I don't really want to investigate that now,that's why I'm sending the patch series anyway.
Hope you enjoy!
(use-modules (guix build-system maven) (guix packages) ((guix licenses) #:prefix license:) (guix git-download)) (let ((commit "775960a985785913fb85428979d253c0b0e1d774") (version "1.0-SNAPSHOT") (revision "0")) (package (name "maven-test") (version (git-version version revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://framagit.org/tyreunom/maven-example-project") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "056p1kc4dpdp8rzxrbp9y0z278hjzpqkrjq63wgcyi0ns5jbc5nv")))) (build-system maven-build-system) (home-page "") (synopsis "") (description "") ;; Note: this package is generated automatically by maven, which is under asl2.0 (license license:asl2.0)))
?