+
+(define-public maven-artifact-transfer
+ (package
+ (name "maven-artifact-transfer")
+ (version "0.12.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://apache/maven/shared/"
+ "maven-artifact-transfer-" version
+ "-source-release.zip"))
+ (sha256
+ (base32
+ "0mkdjr3wnvaxqaq68sy7h4mqlq3xgwwp5s2anj5vbxfy4bsc1ivj"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:tests? #f; require mockito 2
+ #:jar-name "maven-artifact-transfer.jar"
+ #:source-dir "src/main/java"
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'generate-metadata
+ (lambda _
+ (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
+ "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
+ "--source" "src/main/java"
+ "--output" "build/classes/META-INF/plexus/components.xml"
+ "--classes" "build/classes"
+ "--descriptors" "build/classes/META-INF")
+ #t))
+ (add-after 'generate-metadata 'rebuild
+ (lambda _
+ (invoke "ant" "jar")
+ #t))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("java-commons-codec" ,java-commons-codec)
+ ("maven-artifact" ,maven-3.0-artifact)
+ ("maven-core" ,maven-3.0-core)
+ ("maven-common-artifact-filters" ,maven-common-artifact-filters)
+ ("java-plexus-component-annotations" ,java-plexus-component-annotations)
+ ("java-plexus-utils" ,java-plexus-utils)
+ ("java-slf4j-api" ,java-slf4j-api)
+ ("java-plexus-classworlds" ,java-plexus-classworlds)
+ ("java-sonatype-aether-api" ,java-sonatype-aether-api)
+ ("java-eclipse-aether-api" ,java-eclipse-aether-api)
+ ("java-eclipse-aether-util" ,java-eclipse-aether-util)
+ ("java-eclipse-aether-impl" ,java-eclipse-aether-impl)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
+ (home-page "https://maven.apache.org/shared/maven-artifact-transfer")
+ (synopsis "API to install, deploy and resolve artifacts in Maven")
+ (description "This package contains an API to install, deploy and resolve
+artifacts in Maven 3.")
+ (license license:asl2.0)))
+
+(define-public maven-install-plugin
+ (package
+ (name "maven-install-plugin")
+ (version "3.0.0-M1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://apache/maven/plugins/"
+ "maven-install-plugin-" version
+ "-source-release.zip"))
+ (sha256
+ (base32
+ "1l9iydxririrair0i5sk2iypn9wspzbb666lc0ddg20yyr8w39dm"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:tests? #f; require maven-plugin-testing-harness
+ #:jar-name "maven-install-plugin.jar"
+ #:source-dir "src/main/java"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'fix-pom
+ (lambda _
+ (substitute* "pom.xml"
+ (("maven-project") "maven-core")
+ (("maven-artifact-manager") "maven-artifact")
+ (("2.0.6") "3.0"))
+ #t))
+ (add-before 'build 'generate-plugin.xml
+ (generate-plugin.xml "pom.xml"
+ "install"
+ "src/main/java/org/apache/maven/plugins/install"
+ (list
+ (list "AbstractInstallMojo.java" "InstallFileMojo.java")
+ (list "AbstractInstallMojo.java" "InstallMojo.java"))))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-artifact" ,maven-artifact)
+ ("maven-plugin-api" ,maven-plugin-api)
+ ("maven-compat" ,maven-compat)
+ ("maven-artifact-transfer" ,maven-artifact-transfer)
+ ("maven-plugins-pom-23" ,maven-plugins-pom-23)
+ ("java-plexus-digest" ,java-plexus-digest)))
+ (inputs
+ `(("maven-plugin-annotations" ,maven-plugin-annotations)
+ ("java-slf4j-api" ,java-slf4j-api)))
+ (native-inputs
+ `(("unzip" ,unzip)))
+ (home-page "https://maven.apache.org/plugin/maven-install-plugin")
+ (synopsis "Maven's install plugin")
+ (description "The Install Plugin is used during the install phase to add
+artifact(s) to the local repository. The Install Plugin uses the information
+in the POM (groupId, artifactId, version) to determine the proper location for
+the artifact within the local repository.
+
+The local repository is the local cache where all artifacts needed for the
+build are stored. By default, it is located within the user's home directory
+(@file{~/.m2/repository}) but the location can be configured in
+@file{~/.m2/settings.xml} using the @code{<localRepository>} element.")
+ (license license:asl2.0)))
+
+(define-public maven-filtering
+ (package
+ (name "maven-filtering")
+ (version "3.1.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.apache.org/dist/maven/"
+ "shared/maven-filtering-" version
+ "-source-release.zip"))
+ (sha256
+ (base32
+ "09wrdhchnszd2l6h4z30ra0bv1a19qyjgac9z8zf1pn0m4nw05yz"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "maven-filtering.jar"
+ #:source-dir "src/main/java"
+ #:test-dir "src/test"
+ ;; this test comes from sisu-build-api, not this package
+ #:test-exclude (list "**/IncrementalResourceFilteringTest.java"
+ "**/Abstract*.java")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'generate-metadata
+ (lambda _
+ (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
+ "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
+ "--source" "src/main/java"
+ "--output" "build/classes/META-INF/plexus/components.xml"
+ "--classes" "build/classes"
+ "--descriptors" "build/classes/META-INF")
+ #t))
+ (add-after 'generate-metadata 'rebuild
+ (lambda _
+ (invoke "ant" "jar")
+ #t))
+ (add-before 'check 'decompress-tests
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((build-api-source (assoc-ref inputs "java-sisu-build-api-origin"))
+ (classes (string-append build-api-source "/src/test/java")))
+ (copy-recursively classes "src/test/"))
+ #t))
+ (add-before 'check 'fix-directory
+ (lambda _
+ (substitute* (find-files "src/test" ".*.java$")
+ (("target/test-classes/") "build/test-classes/"))))
+ (add-before 'check 'copy-test-resources
+ (lambda _
+ (copy-recursively "src/test/resources" "build/test-classes/")
+ #t))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-core" ,maven-3.0-core)
+ ("maven-shared-utils" ,maven-shared-utils)
+ ("java-plexus-utils" ,java-plexus-utils)
+ ("java-plexus-interpolation" ,java-plexus-interpolation)
+ ("java-sisu-build-api" ,java-sisu-build-api)
+ ("maven-parent-pom" ,maven-parent-pom-30)))
+ (inputs
+ `(("java-jsr305" ,java-jsr305)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-assertj" ,java-assertj)
+ ("java-junit" ,java-junit)
+ ("java-mockito" ,java-mockito-1)
+ ("java-objenesis" ,java-objenesis)
+ ("java-plexus-component-metadata" ,java-plexus-component-metadata)
+ ("java-sisu-build-api-origin" ,(package-source java-sisu-build-api))))
+ (home-page "https://maven.apache.org/shared/maven-filtering")
+ (synopsis "Shared component for all plugins that needs to filter resources")
+ (description "This component provides an API to filter resources in Maven
+projects.")
+ (license license:asl2.0)))
+
+(define-public maven-resources-plugin
+ (package
+ (name "maven-resources-plugin")
+ (version "3.1.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/apache/maven-resources-plugin")
+ (commit (string-append "maven-resources-plugin-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "090k5j2y7ak54czfjjg3v7pdmdlgd96fbs91d1fd3vslm9zzndg8"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "maven-resources-plugin.jar"
+ #:source-dir "src/main/java"
+ #:test-dir "src/test"
+ #:tests? #f; test depends on maven-plugin-test-harness
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-plugin.xml
+ (generate-plugin.xml "pom.xml" "resources"
+ "src/main/java/org/apache/maven/plugins/resources"
+ (list
+ (list "ResourcesMojo.java" "CopyResourcesMojo.java")
+ (list "ResourcesMojo.java")
+ (list "ResourcesMojo.java" "TestResourcesMojo.java"))))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-plugin-api" ,maven-plugin-api)
+ ("maven-core" ,maven-core)
+ ("java-plexus-utils" ,java-plexus-utils)
+ ("maven-filtering" ,maven-filtering)
+ ("java-plexus-interpolation" ,java-plexus-interpolation)
+ ("maven-parent-pom" ,maven-parent-pom-31)))
+ (inputs
+ `(("maven-plugin-annotations" ,maven-plugin-annotations)
+ ("java-commons-io" ,java-commons-io)))
+ (native-inputs
+ `(("java-plexus-component-metadata" ,java-plexus-component-metadata)))
+ (home-page "https://maven.apache.org/plugins/maven-resources-plugin")
+ (synopsis "Maven plugin to collect and install resources")
+ (description "The Resources Plugin handles the copying of project resources
+to the output directory. There are two different kinds of resources: main
+resources and test resources. The difference is that the main resources are
+the resources associated to the main source code while the test resources are
+associated to the test source code.
+
+Thus, this allows the separation of resources for the main source code and its
+unit tests.")
+ (license license:asl2.0)))
+
+(define-public maven-shared-incremental
+ (package
+ (name "maven-shared-incremental")
+ (version "1.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.apache.org/dist/maven/shared/"
+ "maven-shared-incremental-" version
+ "-source-release.zip"))
+ (sha256
+ (base32
+ "03n4nfswyg9ahkz2zx4skcr3ghs01zh95g9js51hc75mfqx9b976"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "shared-incremental.java"
+ #:source-dir "src/main/java"
+ #:test-dir "src/test"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'change-parent
+ (lambda _
+ (substitute* "pom.xml"
+ (("19") "30"))
+ #t))
+ (add-before 'build 'fix-pom
+ (lambda _
+ (substitute* "pom.xml"
+ (("plexus-component-api") "plexus-component-annotations"))
+ #t))
+ (add-after 'build 'generate-metadata
+ (lambda _
+ (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":build/classes")
+ "org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli"
+ "--source" "src/main/java"
+ "--output" "build/classes/META-INF/plexus/components.xml"
+ "--classes" "build/classes"
+ "--descriptors" "build/classes/META-INF")
+ #t))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-plugin-api" ,maven-plugin-api)
+ ("maven-core" ,maven-core)
+ ("maven-shared-utils" ,maven-shared-utils)
+ ("java-plexus-component-annotations" ,java-plexus-component-annotations)
+ ("maven-parent-pom" ,maven-parent-pom-30)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-plexus-component-metadata" ,java-plexus-component-metadata)))
+ (home-page "https://maven.apache.org/shared/maven-shared-incremental")
+ (synopsis "Maven Incremental Build support utilities")
+ (description "This package contains various utility classes and plexus
+components for supporting incremental build functionality in maven plugins.")
+ (license license:asl2.0)))
+
+(define-public maven-compiler-plugin
+ (package
+ (name "maven-compiler-plugin")
+ (version "3.8.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/apache/maven-compiler-plugin")
+ (commit (string-append "maven-compiler-plugin-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jkbq02vykd09ws8k9bzqxv6fjrpmir8gcxydbmj05kkhl242bma"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "maven-compiler-plugin.jar"
+ #:source-dir "src/main/java"
+ #:test-dir "src/test"
+ #:tests? #f; test depends on maven-plugin-test-harness
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-plugin.xml
+ (generate-plugin.xml "pom.xml"
+ "compiler"
+ "src/main/java/org/apache/maven/plugin/compiler"
+ (list
+ (list "AbstractCompilerMojo.java" "CompilerMojo.java")
+ (list "AbstractCompilerMojo.java" "TestCompilerMojo.java"))))
+ (add-after 'generate-plugin.xml 'fix-plugin.xml
+ (lambda _
+ (substitute* "build/classes/META-INF/maven/plugin.xml"
+ ;; These are defined in AbstractCompilerMojo.java, but not
+ ;; parsed correctly in the previous phase
+ (("DEFAULT_TARGET") "1.6")
+ (("DEFAULT_SOURCE") "1.6"))
+ #t))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-plugin-api" ,maven-plugin-api)
+ ("maven-artifact" ,maven-artifact)
+ ("maven-core" ,maven-core)
+ ("maven-shared-utils" ,maven-shared-utils)
+ ("maven-shared-incremental" ,maven-shared-incremental)
+ ("java-plexus-java" ,java-plexus-java)
+ ("java-plexus-compiler-api" ,java-plexus-compiler-api)
+ ("java-plexus-compiler-manager" ,java-plexus-compiler-manager)
+ ("java-plexus-compiler-javac" ,java-plexus-compiler-javac)
+ ("maven-parent-pom" ,maven-parent-pom-33)))
+ (inputs
+ `(("maven-plugin-annotations" ,maven-plugin-annotations)
+ ("java-commons-io" ,java-commons-io)))
+ (home-page "https://maven.apache.org/plugins/maven-compiler-plugin")
+ (synopsis "Compiler plugin for Maven")
+ (description "The Compiler Plugin is used to compile the sources of your
+project. Since 3.0, the default compiler is @code{javax.tools.JavaCompiler}
+(if you are using java 1.6) and is used to compile Java sources. If you want
+to force the plugin using javac, you must configure the plugin option
+@code{forceJavacCompilerUse}.
+
+Also note that at present the default source setting is 1.6 and the default
+target setting is 1.6, independently of the JDK you run Maven with. You are
+highly encouraged to change these defaults by setting source and target as
+described in Setting the -source and -target of the Java Compiler.
+
+Other compilers than javac can be used and work has already started on
+AspectJ, .NET, and C#.")
+ (license license:asl2.0)))
+
+(define-public java-surefire-logger-api
+ (package
+ (name "java-surefire-logger-api")
+ (version "3.0.0-M4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://apache/maven/surefire/"
+ "surefire-" version "-source-release.zip"))
+ (sha256
+ (base32
+ "1s6d4pzk3bjm9l38mj9sfgbgmk145rppdj1dmqwc4d5105mr9q9w"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "java-surefire-logger-api.jar"
+ #:source-dir "surefire-logger-api/src/main/java"
+ #:tests? #f; require mockito 2
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (install-from-pom "surefire-logger-api/pom.xml")))))
+ (propagated-inputs
+ `(("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (native-inputs
+ `(("unzip" ,unzip)))
+ (home-page "https://maven.apache.org/surefire/surefire-logger-api")
+ (synopsis "Interfaces and Utilities related only to internal SureFire Logger API")
+ (description "This package contains interfaces and utilities that are
+internal to the SureFire Logger API. It is designed to have no dependency.")
+ (license license:asl2.0)))
+
+(define-public java-surefire-parent-pom
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-parent-pom")
+ (arguments
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'build)
+ (add-before 'install 'fix-pom-dependency-versions
+ (lambda _
+ (substitute* "pom.xml"
+ (("1.11") ,(package-version java-commons-compress))
+ (("1.13") ,(package-version java-commons-codec)))
+ (substitute* "pom.xml"
+ (("commonsLang3Version>.*")
+ (string-append
+ "commonsLang3Version>"
+ ,(package-version java-commons-lang3)
+ "</commonsLang3Version>\n"))
+ (("commonsCompress>.*")
+ (string-append
+ "commonsCompress>"
+ ,(package-version java-commons-compress)
+ "</commonsCompress>\n"))
+ (("commonsIoVersion>.*")
+ (string-append
+ "commonsIoVersion>"
+ ,(package-version java-commons-io)
+ "</commonsIoVersion>\n"))
+ (("0.11.0") ,(package-version maven-artifact-transfer))
+ (("1.0.3") ,(package-version java-plexus-java)))
+ #t))
+ (add-after 'install 'install-providers
+ (install-pom-file "surefire-providers/pom.xml"))
+ (replace 'install
+ (install-pom-file "pom.xml")))))
+ (propagated-inputs
+ `(("maven-parent-pom" ,maven-parent-pom-33)))))
+
+(define-public java-surefire-api
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-api")
+ (arguments
+ `(#:tests? #f
+ #:jar-name "java-surefire-api.jar"
+ #:source-dir "surefire-api/src/main/java"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'copy-resources
+ (lambda _
+ (mkdir-p "build/classes")
+ (copy-recursively "surefire-api/src/main/resources" "build/classes")
+ #t))
+ (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-codec")))
+ #t))
+ (add-after 'build 'shade
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((jarjar
+ (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
+ (injar "java-surefire-api.jar")
+ (outjar "java-surefire-api-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.api."
+ "org.apache.maven.shared.utils.@1~%"))
+ (format #t (string-append
+ "rule "
+ "org.apache.commons.codec.** "
+ "org.apache.maven.surefire.shade.api."
+ "org.apache.commons.codec.@1~%"))))
+ (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
+ (delete-file injar)
+ (rename-file outjar injar)))
+ #t))
+ (replace 'install
+ (install-from-pom "surefire-api/pom.xml")))))
+ (propagated-inputs
+ `(("java-surefire-logger-api" ,java-surefire-logger-api)
+ ("java-commons-codec" ,java-commons-codec)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)
+ ("maven-shared-utils" ,maven-shared-utils-3.1)))
+ (inputs
+ `(("java-jsr305" ,java-jsr305)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-jarjar" ,java-jarjar)))
+ (synopsis "Maven SureFire API")
+ (description "This package contains the API to use Maven SureFire.")))
+
+(define-public java-surefire-booter
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-booter")
+ (arguments
+ `(#:tests? #f; require mockito 2
+ #:jar-name "java-surefire-booter.jar"
+ #:source-dir "surefire-booter/src/main/java"
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'fix-/bin/sh
+ (lambda _
+ (substitute* "surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java"
+ (("/bin/sh") (which "sh")))
+ #t))
+ (replace 'install
+ (install-from-pom "surefire-booter/pom.xml")))))
+ (propagated-inputs
+ `(("java-surefire-api" ,java-surefire-api)
+ ("java-commons-lang3" ,java-commons-lang3)
+ ("java-commons-io" ,java-commons-io)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (inputs
+ `(("java-jsr305" ,java-jsr305)))
+ (synopsis "API and Facilities used by forked tests running in JVM sub-process")
+ (description "SureFire runs tests inside a forked JVM subprocess. This
+package contains an API and facilities used inside that forked JVM.")))
+
+(define-public java-surefire-extensions-api
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-extensions-api")
+ (arguments
+ `(#:tests? #f; requires mockito 2
+ #:jar-name "java-surefire-extensions-api.jar"
+ #:source-dir "surefire-extensions-api/src/main/java"
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (install-from-pom "surefire-extensions-api/pom.xml")))))
+ (propagated-inputs
+ `(("java-surefire-api" ,java-surefire-api)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (inputs
+ `(("java-plexus-component-annotations" ,java-plexus-component-annotations)))
+ (synopsis "Extension API for Maven SureFire")
+ (description "Surefire is a test framework project. This is the aggregator
+POM in Apache Maven Surefire project.")))
+
+(define-public java-surefire-common-java5
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-common-java5")
+ (arguments
+ `(#:jar-name "java-surefire-common-java5.jar"
+ #:source-dir "surefire-providers/common-java5/src/main/java"
+ #:test-dir "surefire-providers/common-java5/src/test"
+ #:test-exclude (list
+ ;; Abstract class
+ "**/PojoStackTraceWriterTest.java"
+ ;; Fails
+ "**/SmartStackTraceParserTest.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 (jar-file)
+ (invoke "jar" "xf" jar-file)
+ (delete-file-recursively "META-INF"))
+ (find-files (assoc-ref inputs "maven-shared-utils") ".*.jar$")))
+ #t))
+ (add-after 'build 'shade
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((jarjar
+ (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
+ (injar "java-surefire-common-java5.jar")
+ (outjar "java-surefire-common-java5-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~%"))))
+ (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
+ (delete-file injar)
+ (rename-file outjar injar)))
+ #t))
+ (replace 'install
+ (install-from-pom "surefire-providers/common-java5/pom.xml")))))
+ (propagated-inputs
+ `(("maven-shared-utils" ,maven-shared-utils-3.1)
+ ("java-surefire-api" ,java-surefire-api)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-jarjar" ,java-jarjar)
+ ("java-junit" ,java-junit)
+ ("java-fest-assert" ,java-fest-assert)))
+ (synopsis "Common java5 facilities for Maven SureFire")
+ (description "This package contains shared Java 5 code for all providers.")))
+
+(define-public java-surefire-common-junit3
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-common-junit3")
+ (arguments
+ `(#:jar-name "java-surefire-common-junit3.jar"
+ #:source-dir "surefire-providers/common-junit3/src/main/java"
+ #:test-dir "surefire-providers/common-junit3/src/test"
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (install-from-pom "surefire-providers/common-junit3/pom.xml")))))
+ (propagated-inputs
+ `(("java-junit" ,java-junit)
+ ("java-surefire-api" ,java-surefire-api)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("java-junit" ,java-junit)
+ ("java-fest-assert" ,java-fest-assert)))
+ (synopsis "Shared JUnit3 provider code for Maven SureFire")
+ (description "This package contains shared code for all JUnit providers.")))
+
+(define-public java-surefire-common-junit4
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-common-junit4")
+ (arguments
+ `(#:jar-name "java-surefire-common-junit4.jar"
+ #:source-dir "surefire-providers/common-junit4/src/main/java"
+ #:tests? #f; tests require junit 4.0
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (install-from-pom "surefire-providers/common-junit4/pom.xml")))))
+ (propagated-inputs
+ `(("java-junit" ,java-junit)
+ ("java-surefire-api" ,java-surefire-api)
+ ("java-surefire-common-java5" ,java-surefire-common-java5)
+ ("java-surefire-common-junit3" ,java-surefire-common-junit3)
+ ("maven-shared-utils" ,maven-shared-utils-3.1)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (synopsis "Shared JUnit4 provider code for Maven SureFire")
+ (description "This package contains shared code for all JUnit providers,
+starting from JUnit 4.")))
+
+(define-public java-surefire-junit4
+ (package
+ (inherit java-surefire-logger-api)
+ (name "java-surefire-junit4")
+ (arguments
+ `(;#:tests? #f
+ #:jar-name "java-surefire-junit4.jar"
+ #:source-dir "surefire-providers/surefire-junit4/src/main/java"
+ #:test-dir "surefire-providers/surefire-junit4/src/test"
+ #:modules ((guix build ant-build-system)
+ (guix build utils)
+ (guix build java-utils)
+ (sxml simple))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'install 'regenerate-own-pom
+ (lambda _
+ ;; Surefire struggles resolving artifacts because of this pom
+ ;; file, resulting in a NullPointerException when collecting
+ ;; Artifacts (and a "Failure detected." message from
+ ;; DefaultArtifactResolver). Replace the pom file with a much
+ ;; simpler one. Everything is shaded anyway (as used to be the
+ ;; case in 2.22), so there will not be missing dependencies.
+ (with-output-to-file "surefire-providers/surefire-junit4/pom.xml"
+ (lambda _
+ (sxml->xml
+ `((project
+ (modelVersion "4.0.0")
+ (name "Surefire JUnit4")
+ (groupId "org.apache.maven.surefire")
+ (artifactId "surefire-junit4")
+ (version ,,(package-version java-surefire-common-java5)))))))
+ #t))
+ (add-before 'build 'copy-resources
+ (lambda _
+ (mkdir-p "build/classes")
+ (copy-recursively "surefire-providers/surefire-junit4/src/main/resources"
+ "build/classes")
+ #t))
+ (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-surefire-common-java5"
+ "java-surefire-common-junit3" "java-surefire-common-junit4"
+ "java-surefire-api")))
+ #t))
+ (add-after 'build 'shade
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((jarjar
+ (car (find-files (assoc-ref inputs "java-jarjar") ".*.jar$")))
+ (injar "java-surefire-junit4.jar")
+ (outjar "java-surefire-junit4-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."
+ "org.apache.maven.shared.utils.@1~%"))))
+ (invoke "java" "-jar" jarjar "process" "rules" injar outjar)
+ (delete-file injar)
+ (rename-file outjar injar)))
+ #t))
+ (replace 'install
+ (install-from-pom "surefire-providers/surefire-junit4/pom.xml")))))
+ (propagated-inputs
+ `(("java-junit" ,java-junit)
+ ("java-surefire-parent-pom" ,java-surefire-parent-pom)))
+ (inputs
+ `(("java-surefire-common-junit4" ,java-surefire-common-junit4)
+ ("java-surefire-common-junit3" ,java-surefire-common-junit3)
+ ("java-surefire-common-java5" ,java-surefire-common-java5)
+ ("java-surefire-api" ,java-surefire-api)))
+ (native-inputs
+ `(("java-jarjar" ,java-jarjar)
+ ("unzip" ,unzip)
+ ("java-junit" ,java-junit)
+ ("java-hamcrest-all" ,java-hamcrest-all)
+ ("java-fest-assert" ,java-fest-assert)))
+ (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.")))
+
+(define-public maven-surefire-plugin
+ (package
+ (inherit java-surefire-logger-api)
+ (name "maven-surefire-plugin")
+ (arguments
+ `(#:jar-name "maven-surefire-plugin.jar"
+ #:source-dir "maven-surefire-plugin/src/main/java"
+ #:tests? #f; test depends on maven-plugin-test-harness
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-plugin.xml
+ (generate-plugin.xml "maven-surefire-plugin/pom.xml"
+ "surefire"
+ "."
+ (list
+ (list
+ "maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java"
+ "maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java"))))
+ (replace 'install
+ (install-from-pom "maven-surefire-plugin/pom.xml")))))
+ (propagated-inputs
+ `(("maven-surefire-common" ,maven-surefire-common)
+ ("maven-core" ,maven-core)))
+ (native-inputs
+ `(("maven-plugin-annotations" ,maven-plugin-annotations)
+ ("unzip" ,unzip)))
+ (synopsis "SureFire Maven plugin that runs tests.")
+ (description "The Surefire Plugin is used during the test phase of the
+build lifecycle to execute the unit tests of an application. It generates
+reports in two different file formats, plain text and xml.")))
+
+(define-public maven-jar-plugin
+ (package
+ (name "maven-jar-plugin")
+ (version "3.2.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/apache/maven-jar-plugin")
+ (commit (string-append "maven-jar-plugin-" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04y2rlmcabmc55ljqlkgbb5xx94a59cz1dvrnpfj1vzz024pqkyg"))))
+ (build-system ant-build-system)
+ (arguments
+ `(#:jar-name "maven-jar-plugin.jar"
+ #:source-dir "src/main/java"
+ #:tests? #f; test depends on maven-plugin-test-harness
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-plugin.xml
+ (generate-plugin.xml "pom.xml"
+ "jar"
+ "src/main/java/org/apache/maven/plugins/jar"
+ (list
+ (list "AbstractJarMojo.java" "JarMojo.java")
+ (list "AbstractJarMojo.java" "TestJarMojo.java"))))
+ (replace 'install
+ (install-from-pom "pom.xml")))))
+ (propagated-inputs
+ `(("maven-archiver" ,maven-archiver)
+ ("maven-artifact" ,maven-3.0-artifact)
+ ("maven-core" ,maven-3.0-core)
+ ("maven-plugin-api" ,maven-3.0-plugin-api)
+ ("maven-file-management" ,maven-file-management)
+ ("maven-shared-utils" ,maven-shared-utils)
+ ("java-plexus-archiver" ,java-plexus-archiver)
+ ("java-plexus-utils" ,java-plexus-utils)))
+ (inputs
+ `(("maven-plugin-annotations" ,maven-plugin-annotations)))
+ (home-page "https://maven.apache.org/plugins/maven-jar-plugin")
+ (synopsis "Jar builder plugin for Maven")
+ (description "This plugin provides the capability to build jars. If you
+would like to sign jars please use the Maven Jarsigner Plugin instead.")
+ (license license:asl2.0)))