mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
guix: java-utils: Factorize pom.xml generation.
* guix/build/java-utils.scm (generate-pom.xml): New procedure. * gnu/packages/maven.scm (java-surefire-junit4): Use it. * gnu/packages/java.scm (java-qdox, java-jsr250, java-jsr305) (java-aopalliance, java-jboss-el-api-spec) (java-jboss-interceptors-api-spec): Use it. (java-qdox-M9): Ensure the generated pom file has the correct version.
This commit is contained in:
parent
a40207bd6f
commit
4c98db94b0
3 changed files with 58 additions and 116 deletions
|
|
@ -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)))))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue