From 4c98db94b0271aa5371ff00cf98c0ebc70ab1a8d Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:14 +0200 Subject: 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. --- gnu/packages/java.scm | 117 ++++++++------------------------------------------ 1 file changed, 18 insertions(+), 99 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 471cc5e906..59f9497ec2 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -3847,25 +3847,11 @@ (define-public java-qdox (arguments `(#:jar-name "qdox.jar" #:tests? #f; no tests - #:modules - ((guix build ant-build-system) - (guix build java-utils) - (guix build utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "QDox") - (groupId "com.thoughtworks.qdox") - (artifactId "qdox") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version + #:name "QDox")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://github.com/codehaus/qdox") @@ -3891,7 +3877,14 @@ (define-public java-qdox-2-M9 "/qdox-" version "-sources.jar")) (sha256 (base32 - "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg")))))) + "1s2jnmx2dkwnaha12lcj26aynywgwa8sslc47z82wx8xai13y4fg")))) + (arguments + (substitute-keyword-arguments (package-arguments java-qdox) + ((#:phases phases) + `(modify-phases ,phases + (replace 'create-pom + (generate-pom.xml "pom.xml" "com.thoughtworks.qdox" "qdox" ,version + #:name "QDox")))))))) (define-public java-jarjar (package @@ -6463,25 +6456,11 @@ (define-public java-jsr250 `(#:tests? #f ; no tests included #:jdk ,icedtea-8 #:jar-name "jsr250.jar" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "jsr250") - (groupId "javax.annotation") - (artifactId "jsr250-api") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "javax.annotation" "jsr250-api" ,version + #:name "jsr250")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://jcp.org/en/jsr/detail?id=250") @@ -6510,25 +6489,10 @@ (define-public java-jsr305 (arguments `(#:tests? #f ; no tests included #:jar-name "jsr305.jar" - #:modules ((guix build ant-build-system) - (guix build java-utils) - (guix build maven pom) - (guix build utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "jsr305") - (groupId "com.google.code.findbugs") - (artifactId "jsr305") - (version ,,version)))))) - #t)) + (generate-pom.xml "pom.xml" "com.google.code.findbugs" "jsr305" ,version)) (replace 'install (install-from-pom "pom.xml"))))) (home-page "http://findbugs.sourceforge.net/") @@ -10559,25 +10523,10 @@ (define-public java-aopalliance #:jdk ,icedtea-8 #:tests? #f; no tests #:source-dir "aopalliance/src/main" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases (add-before 'install 'create-pom - (lambda _ - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `((project - (modelVersion "4.0.0") - (name "aopalliance") - (groupId "aopalliance") - (artifactId "aopalliance") - (version "1.0")))))) - #t)) + (generate-pom.xml "pom.xml" "aopalliance" "aopalliance" ,version)) (replace 'install (install-from-pom "pom.xml"))))) (home-page "http://aopalliance.sourceforge.net") @@ -12176,29 +12125,14 @@ (define-public java-jboss-el-api-spec (build-system ant-build-system) (arguments `(#:jar-name "java-jboss-el-api_spec.jar" - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases ;; the origin of javax.el:javax.el-api is unknown, so we use this package ;; instead, which implements the same thing. We override the pom file ;; to "rename" the package so it can be found by maven. (add-before 'install 'override-pom - (lambda _ - (delete-file "pom.xml") - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `(project - (modelVersion "4.0.0") - (name "el-api") - (groupId "javax.el") - (artifactId "javax.el-api") - (version "3.0"))))) - #t)) + (generate-pom.xml "pom.xml" "javax.el" "javax.el-api" "3.0" + #:name "el-api")) (replace 'install (install-from-pom "pom.xml"))))) (inputs @@ -12230,11 +12164,6 @@ (define-public java-jboss-interceptors-api-spec #:jdk ,icedtea-8 #:source-dir "." #:tests? #f; no tests - #:modules ((guix build ant-build-system) - (guix build utils) - (guix build maven pom) - (guix build java-utils) - (sxml simple)) #:phases (modify-phases %standard-phases ;; the origin of javax.interceptor:javax.interceptor-api is unknown, @@ -12242,18 +12171,8 @@ (define-public java-jboss-interceptors-api-spec ;; We override the pom file to "rename" the package so it can be found ;; by maven. (add-before 'install 'override-pom - (lambda _ - (delete-file "pom.xml") - (with-output-to-file "pom.xml" - (lambda _ - (sxml->xml - `(project - (modelVersion "4.0.0") - (name "interceptor-api") - (groupId "javax.interceptor") - (artifactId "javax.interceptor-api") - (version "3.0"))))) - #t)) + (generate-pom.xml "pom.xml" "javax.interceptor" "javax.interceptor-api" + "3.0" #:name "interceptor-api")) (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://github.com/jboss/jboss-interceptors-api_spec") -- cgit v1.2.3 From 01706f6e0081674dffa39a49c33e04d48aad5300 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:22 +0200 Subject: gnu: Add java-jopt-simple-4. * gnu/packges/java.scm (java-jopt-simple-4): New variable. (java-jopt-simple): Install to maven repository structure. --- gnu/packages/java.scm | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 59f9497ec2..b34e31a612 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016 Leo Famulari ;;; Copyright © 2016, 2017 Roel Janssen ;;; Copyright © 2017, 2019, 2021 Carlo Zancanaro -;;; Copyright © 2017-2020 Julien Lepiller +;;; Copyright © 2017-2021 Julien Lepiller ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2016, 2017, 2018 Alex Vong ;;; Copyright © 2017, 2019, 2021 Tobias Geerinckx-Rice @@ -5781,7 +5781,13 @@ (define-public java-jopt-simple (build-system ant-build-system) (arguments `(#:tests? #f ; there are no tests - #:jar-name "jopt-simple.jar")) + #:jar-name "jopt-simple.jar" + #:phases + (modify-phases %standard-phases + (add-before 'install 'create-pom + (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" ,version)) + (replace 'install + (install-from-pom "pom.xml"))))) (home-page "https://pholser.github.io/jopt-simple/") (synopsis "Java library for parsing command line options") (description "JOpt Simple is a Java library for parsing command line @@ -5793,6 +5799,28 @@ (define-public java-jopt-simple overly clever.") (license license:expat))) +;; Required by jmh +(define-public java-jopt-simple-4 + (package + (inherit java-jopt-simple) + (version "4.6") + (source (origin + (method url-fetch) + (uri (string-append "https://repo1.maven.org/maven2/" + "net/sf/jopt-simple/jopt-simple/" + version "/jopt-simple-" + version "-sources.jar")) + (sha256 + (base32 + "0ny82zczxkn201ld0b7rps0ifzjhfs8m1ncdmy1f50145ciszkpd")))) + (arguments + (substitute-keyword-arguments (package-arguments java-jopt-simple) + ((#:phases phases) + `(modify-phases ,phases + (replace 'create-pom + (generate-pom.xml "pom.xml" "net.sf.jopt-simple" "jopt-simple" + ,version)))))))) + (define-public java-commons-math3 (package (name "java-commons-math3") -- cgit v1.2.3 From 887410838628a9a1d5c15e71a6e48f4afd9ec33b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:23 +0200 Subject: gnu: java-commons-math3: Install to maven repository. * gnu/packages/java.scm (java-commons-math3)[phases]: Use install-from-pom. --- gnu/packages/java.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index b34e31a612..dd30e70635 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -5855,7 +5855,7 @@ (define-public java-commons-math3 #t)) ;; There is no install target. (replace 'install - (install-jars "target"))))) + (install-from-pom "pom.xml"))))) (native-inputs `(("java-junit" ,java-junit) ("java-hamcrest-core" ,java-hamcrest-core))) -- cgit v1.2.3 From 901d48cc17ea635a34e004b1d07a2e2a9bde6188 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:26 +0200 Subject: gnu: java-jmh: Update to 1.32. * gnu/packages/java.scm (java-jmh): Update to 1.32. [source]: Switch to the git repository. --- gnu/packages/java.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index dd30e70635..7a9f1c3538 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -5869,16 +5869,16 @@ (define-public java-commons-math3 (define-public java-jmh (package (name "java-jmh") - (version "1.17.5") + (version "1.32") (source (origin - (method hg-fetch) - (uri (hg-reference - (url "http://hg.openjdk.java.net/code-tools/jmh/") - (changeset version))) - (file-name (string-append name "-" version "-checkout")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/openjdk/jmh") + (commit version))) + (file-name (git-file-name name version)) (sha256 (base32 - "1fxyxhg9famwcg1prc4cgwb5wzyxqavn3cjm5vz8605xz7x5k084")))) + "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0")))) (build-system ant-build-system) (arguments `(#:jar-name "jmh-core.jar" -- cgit v1.2.3 From 1b1eeb3b123162c4d73c939e9ca7bbbb4f79aef1 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:27 +0200 Subject: gnu: java-jmh: Switch to maven-build-system. * gnu/packages/java.scm (java-jmh): Switch to maven-build-system. --- gnu/packages/java.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 7a9f1c3538..270f2489e1 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -44,6 +44,7 @@ (define-module (gnu packages java) #:use-module (guix utils) #:use-module (guix build-system ant) #:use-module (guix build-system gnu) + #:use-module (guix build-system maven) #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages attr) @@ -5879,26 +5880,27 @@ (define-public java-jmh (sha256 (base32 "0i7fa7l3gdqkkgz5ddayp6m46dgbj9rqlz35xffrcbyiz3gpljy0")))) - (build-system ant-build-system) + (build-system maven-build-system) (arguments - `(#:jar-name "jmh-core.jar" - #:source-dir "jmh-core/src/main" - #:test-dir "jmh-core/src/test" + `(#:exclude + (("org.apache.maven.plugins" . + ("maven-source-plugin" "maven-archetype-plugin" "maven-shade-plugin" + "maven-site-plugin" "maven-javadoc-plugin" "maven-eclipse-plugin")) + ("com.mycila.maven-license-plugin" . ("maven-license-plugin")) + ("org.apache.maven.wagon" . ("wagon-ssh"))) + #:maven-plugins + (("maven-enforcer-plugin" ,maven-enforcer-plugin) + ,@(default-maven-plugins)) #:phases (modify-phases %standard-phases - ;; This seems to be a bug in the JDK. It may not be necessary in - ;; future versions of the JDK. - (add-after 'unpack 'fix-bug + (add-after 'unpack 'remove-unnecessary (lambda _ - (with-directory-excursion - "jmh-core/src/main/java/org/openjdk/jmh/runner/options" - (substitute* '("IntegerValueConverter.java" - "ThreadsValueConverter.java") - (("public Class valueType") - "public Class valueType"))) - #t))))) - (inputs - `(("java-jopt-simple" ,java-jopt-simple) + ;; requires org.apache.maven.archetype:archetype-packaging. + ;; Its subprojects also require groovy, kotlin and scala, + ;; respectively. + (delete-file-recursively "jmh-archetypes")))))) + (propagated-inputs + `(("java-jopt-simple" ,java-jopt-simple-4) ("java-commons-math3" ,java-commons-math3))) (native-inputs `(("java-junit" ,java-junit) -- cgit v1.2.3 From 347846ea86e73eb34c2296d6a58edf575c543440 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 22 Jun 2021 14:19:34 +0200 Subject: gnu: java-kafka-clients: Disable failing test. * gnu/packages/java.scm (java-kafka-clients): Disable a test that fails non-deterministically. --- gnu/packages/java.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 270f2489e1..64df5a2e24 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -11681,7 +11681,9 @@ (define-public java-kafka-clients "**/ClientUtilsTest.java" ;; End with errors that seem related to our powermock "**/KafkaProducerTest.java" - "**/BufferPoolTest.java"))) + "**/BufferPoolTest.java" + ;; Undeterministic failure, seems to affect mostly ci + "**/GarbageCollectedMemoryPoolTest.java"))) (inputs `(("java-slf4j-api" ,java-slf4j-api) ("java-lz4" ,java-lz4))) -- cgit v1.2.3