summary refs log tree commit diff
path: root/gnu/packages/maven.scm
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2020-06-27 23:58:07 +0200
committerJulien Lepiller <julien@lepiller.eu>2020-07-17 04:21:13 +0200
commitb777e194376ec5ace990789e92251f89983da3e6 (patch)
tree3516de8dbe960f9e36da7c7a4e7f0e0906ea45cc /gnu/packages/maven.scm
parente1ee5a75f3017315bb82f38b068bd4c003464b64 (diff)
downloadguix-b777e194376ec5ace990789e92251f89983da3e6.tar.gz
gnu: Add maven-surefire-common.
* gnu/packages/maven.scm (maven-surefire-common): New variable.
* gnu/packages/java.scm (java-hawtjni, java-jansi-native, java-jansi):
Install from pom file.
Diffstat (limited to 'gnu/packages/maven.scm')
-rw-r--r--gnu/packages/maven.scm88
1 files changed, 88 insertions, 0 deletions
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index cbeda43b72..bfb5a51807 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -3495,3 +3495,91 @@ starting from JUnit 4.")))
     (synopsis "SureFire JUnit 4.0+ runner")
     (description "This package contains the runner for tests run on a forked
 JVM, using JUnit 4.0 or later.")))
+
+(define-public maven-surefire-common
+  (package
+    (inherit java-surefire-logger-api)
+    (name "maven-surefire-common")
+    (arguments
+     `(#:tests? #f; require mockito 2
+       #:jar-name "maven-surefire-common.jar"
+       #:source-dir "maven-surefire-common/src/main/java"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'prepare-shade
+           (lambda* (#:key inputs #:allow-other-keys)
+             (mkdir-p "build/classes")
+             (with-directory-excursion "build/classes"
+               (for-each
+                 (lambda (input)
+                   (for-each
+                     (lambda (jar-file)
+                       (invoke "jar" "xf" jar-file)
+                       (delete-file-recursively "META-INF"))
+                     (find-files (assoc-ref inputs input) ".*.jar$")))
+                 '("maven-shared-utils" "java-commons-io" "java-commons-lang3"
+                   "java-commons-compress" "maven-common-artifact-filters")))
+             #t))
+         (add-after 'build 'shade
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((jarjar
+                   (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
+                   (injar "maven-surefire-common.jar")
+                   (outjar "maven-surefire-common-shaded.jar"))
+               (with-directory-excursion "build/jar"
+                 (with-output-to-file "rules"
+                   (lambda _
+                     (format #t (string-append
+                                  "rule "
+                                  "org.apache.maven.shared.utils.** "
+                                  "org.apache.maven.surefire.shade.common."
+                                  "org.apache.maven.shared.utils.@1~%"))
+                     (format #t (string-append
+                                  "rule "
+                                  "org.apache.commons.io.** "
+                                  "org.apache.maven.surefire.shade.common."
+                                  "org.apache.commons.io.@1~%"))
+                     (format #t (string-append
+                                  "rule "
+                                  "org.apache.commons.lang3.** "
+                                  "org.apache.maven.surefire.shade.common."
+                                  "org.apache.commons.lang3.@1~%"))
+                     (format #t (string-append
+                                  "rule "
+                                  "org.apache.commons.compress.** "
+                                  "org.apache.maven.surefire.shade.common."
+                                  "org.apache.commons.compress.@1~%"))))
+                 (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
+                 (delete-file injar)
+                 (rename-file outjar injar)))
+             #t))
+         (add-before 'install 'fix-pom
+           (lambda _
+             (substitute* "maven-surefire-common/pom.xml"
+               (("maven-toolchain") "maven-core"))
+             #t))
+         (replace 'install
+           (install-from-pom "maven-surefire-common/pom.xml")))))
+    (propagated-inputs
+     `(("java-surefire-api" ,java-surefire-api)
+       ("java-surefire-extensions-api" ,java-surefire-extensions-api)
+       ("java-surefire-booter" ,java-surefire-booter)
+       ("maven-core" ,maven-core)
+       ("maven-plugin-annotations" ,maven-plugin-annotations)
+       ("maven-common-artifact-filters" ,maven-common-artifact-filters)
+       ("maven-artifact-transfer" ,maven-artifact-transfer)
+       ("java-plexus-java" ,java-plexus-java)
+       ("java-jansi" ,java-jansi)
+       ("java-commons-io" ,java-commons-io)
+       ("java-commons-lang3" ,java-commons-lang3)
+       ("java-commons-compress" ,java-commons-compress)
+       ("maven-shared-utils" ,maven-shared-utils-3.1)
+       ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+    (inputs
+     `(("java-jsr305" ,java-jsr305)))
+    (native-inputs
+     `(("unzip" ,unzip)
+       ("java-jarjar" ,java-jarjar)))
+    (synopsis "API used in Surefire and Failsafe MOJO")
+    (description "This package contains an API used in SureFire and Failsafe
+MOJO.")))