summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/java-utils.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/guix/build/java-utils.scm b/guix/build/java-utils.scm
index a868e4d52c..6abd97e118 100644
--- a/guix/build/java-utils.scm
+++ b/guix/build/java-utils.scm
@@ -28,6 +28,7 @@
#:use-module (sxml simple)
#:export (ant-build-javadoc
generate-plugin.xml
+ generate-pom.xml
install-jars
install-javadoc
install-pom-file
@@ -206,3 +207,31 @@ recognize the package as a plugin, and find the entry points in the plugin."
,mojos
(dependencies
,@dependencies)))))))))
+
+(define* (generate-pom.xml pom-file groupid artifactid version
+ #:key (dependencies '())
+ (name artifactid))
+ "Generates the @file{pom.xml} for a project. It is required by Maven to find
+a package, and by the java build system to know where to install a package, when
+a pom.xml doesn't already exist and installing to the maven repository."
+ (lambda _
+ (mkdir-p (dirname pom-file))
+ (with-output-to-file pom-file
+ (lambda _
+ (sxml->xml
+ (sxml-indent
+ `(project
+ (modelVersion "4.0.0")
+ (name ,name)
+ (groupId ,groupid)
+ (artifactId ,artifactid)
+ (version ,version)
+ (dependencies
+ ,@(map
+ (match-lambda
+ ((groupid artifactid version)
+ `(dependency
+ (groupId ,groupid)
+ (artifactId ,artifactid)
+ (version ,version))))
+ dependencies)))))))))