[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#31774] [PATCH 12/22] gnu: Add maven-core.
From: |
Danny Milosavljevic |
Subject: |
[bug#31774] [PATCH 12/22] gnu: Add maven-core. |
Date: |
Thu, 14 Jun 2018 02:18:09 +0200 |
From: Julien Lepiller <address@hidden>
* gnu/packages/maven.scm (maven-core): New variable.
---
gnu/packages/maven.scm | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index dff5bd3e4..ea6be7a7d 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -752,3 +752,73 @@ so really just plain objects.")))
("java-junit" ,java-junit)
("java-mockito-1" ,java-mockito-1)
("java-commons-jxpath" ,java-commons-jxpath)))))
+
+(define-public maven-core
+ (package
+ (inherit maven-core-bootstrap)
+ (arguments
+ (substitute-keyword-arguments (package-arguments maven-core-bootstrap)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'build 'modify-metainf
+ (lambda _
+ (substitute* "build.xml"
+ (("message=\"\"") "message=\"Implementation-Version:
3.5.3\n\""))
+ #t))
+ (add-before 'build 'add-maven-files
+ (lambda _
+ (mkdir-p
"build/classes/META-INF/maven/org.apache.maven/maven-core")
+ (copy-file "pom.xml"
+
"build/classes/META-INF/maven/org.apache.maven/maven-core/pom.xml")
+ (with-output-to-file
"build/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties"
+ (lambda _
+ (format #t "version=~a~%
+groupId=org.apache.maven~%
+artifactId=maven-core" ,(package-version maven-core-bootstrap))))
+ #t))
+ (add-after 'build 'generate-metadata
+ (lambda _
+ (define (components file)
+ (let ((sxml (with-input-from-file file
+ (lambda _ (xml->sxml (current-input-port)
#:trim-whitespace? #t)))))
+ ;; Select the list of <component>s inside the
<component-set>
+ ;; and <components>.
+ ((@ (ice-9 match) match) sxml
+ (('*TOP*
+ ('*PI* foo ...)
+ ('component-set
+ ('components x ...))) x))))
+ (use-modules (sxml simple))
+ (delete-file "build/classes/META-INF/plexus/components.xml")
+ (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
":build/classes")
+
"org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
+ "--source" "build/classes/META-INF/plexus"
+ "--output"
"build/classes/META-INF/plexus/components.t.xml"
+ "--classes" "build/classes"
+ "--descriptors" "build/classes")
+ ;; Now we merge all other components from hand-written xml
+ (let ((generated-xml (components
"build/classes/META-INF/plexus/components.t.xml"))
+ (components-xml (components
"src/main/resources/META-INF/plexus/components.xml"))
+ (default-bindings-xml (components
"src/main/resources/META-INF/plexus/default-bindings.xml"))
+ (artifact-handlers-xml (components
"src/main/resources/META-INF/plexus/artifact-handlers.xml")))
+ (with-output-to-file
"build/classes/META-INF/plexus/components.xml"
+ (lambda _
+ (display (sxml->string
+ `(component-set
+ (components
+ ,@(append generated-xml components-xml
+ default-bindings-xml
+ artifact-handlers-xml))))))))
+ #t))
+ (add-after 'generate-metadata 'rebuild
+ (lambda _
+ (invoke "ant" "jar")
+ #t))))))
+ (native-inputs
+ `(("java-plexus-component-metadata" ,java-plexus-component-metadata)
+ ("java-commons-cli" ,java-commons-cli)
+ ("java-plexus-cli" ,java-plexus-cli)
+ ("java-jdom2" ,java-jdom2)
+ ("java-qdox" ,java-qdox)
+ ("maven-core-boot" ,maven-core-bootstrap)
+ ,@(package-native-inputs maven-core-bootstrap)))))
- [bug#31774] [PATCH 10/22] gnu: Add maven-plugin-annotations., (continued)
- [bug#31774] [PATCH 11/22] gnu: Add java-plexus-component-metadata., Julien Lepiller, 2018/06/10
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Julien Lepiller, 2018/06/10
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Danny Milosavljevic, 2018/06/10
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Julien Lepiller, 2018/06/10
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Danny Milosavljevic, 2018/06/11
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Julien Lepiller, 2018/06/12
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Danny Milosavljevic, 2018/06/13
- [bug#31774] [PATCH 12/22] gnu: Add maven-core., Ludovic Courtès, 2018/06/14
- [bug#31774] [PATCH 12/22] gnu: Add maven-core.,
Danny Milosavljevic <=
[bug#31774] [PATCH 04/22] gnu: Add java-eclipse-jetty-webapp., Julien Lepiller, 2018/06/10
[bug#31774] [PATCH 07/22] gnu: Add java-qdox., Julien Lepiller, 2018/06/10
[bug#31774] [PATCH 13/22] gnu: Add maven-embedder., Julien Lepiller, 2018/06/10
[bug#31774] [PATCH 17/22] gnu: Add maven-wagon-tck-http., Julien Lepiller, 2018/06/10
[bug#31774] [PATCH 09/22] gnu: Add maven-core-bootstrap., Julien Lepiller, 2018/06/10