diff options
author | Julien Lepiller <julien@lepiller.eu> | 2020-06-26 23:22:04 +0200 |
---|---|---|
committer | Julien Lepiller <julien@lepiller.eu> | 2020-07-17 04:14:45 +0200 |
commit | 51087d51df20b89cf081aaa895efadbb73e6550b (patch) | |
tree | af0ad2c03dc36c8ff78afae0bb5cdbc4496e8e0d /gnu/packages | |
parent | 968bb6827577fdb70216d03fbe9db79f1f0aa09f (diff) | |
download | guix-51087d51df20b89cf081aaa895efadbb73e6550b.tar.gz |
gnu: maven: Install from pom file.
* gnu/packages/java.scm (java-plexus-container-default-bootstrap) (java-plexus-component-annotations, java-plexus-cipher, java-asm) (java-jsr250, java-commons-cli, java-slf4j-api, java-slf4j-simple) (java-bsh, java-jboss-el-api-spec, java-jboss-interceptors-api-spec) (java-cdi-api, java-eclipse-sisu-plexus): Install from pom file. * gnu/packages/maven.scm (maven-resolver-api, maven-resolver-spi) (maven-resolver-util, maven-resolver-connector-basic, maven-resolver-impl) (java-plexus-utils, maven-artifact, maven-model, maven-builder-support) (maven-settings, maven-settings-builder, maven-model-builder) (maven-repository-metadata, maven-resolver-provider, maven-plugin-api) (maven-core, maven-embedder, maven-compat): Install from pom file.
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/java-compression.scm | 5 | ||||
-rw-r--r-- | gnu/packages/java.scm | 263 | ||||
-rw-r--r-- | gnu/packages/maven.scm | 295 |
3 files changed, 436 insertions, 127 deletions
diff --git a/gnu/packages/java-compression.scm b/gnu/packages/java-compression.scm index 3abc0ea071..112f04af53 100644 --- a/gnu/packages/java-compression.scm +++ b/gnu/packages/java-compression.scm @@ -231,10 +231,9 @@ compressor/decompressor.") (replace 'install (install-from-pom "pom.xml"))))) (home-page "https://github.com/dain/snappy") (native-inputs - `(("guava" ,java-guava) + `(("java-guava" ,java-guava) ("java-snappy" ,java-snappy) - ("hamcrest" ,java-hamcrest-core) - ("testng" ,java-testng))) + ("java-testng" ,java-testng))) (synopsis "Java port of the Snappy (de)compressor") (description "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 912f7d808e..dfb84fc410 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -3591,11 +3591,11 @@ documentation tools.") (("<path id=\"path.build\">") (string-append "<path id=\"path.build\"><fileset dir=\"" (assoc-ref inputs "java-asm-bootstrap") - "/share/java\" includes=\"**/*.jar\"/>")) + "/lib/m2\" includes=\"**/*.jar\"/>")) (("<zipfileset src=\"lib/asm-4.0.jar\"/>") "") (("lib/asm-commons-4.0.jar") - (string-append (assoc-ref inputs "java-asm-bootstrap") - "/share/java/asm-6.0.jar")) + (car (find-files (assoc-ref inputs "java-asm-bootstrap") + "asm-6.0.jar"))) (("<include name=\"org/objectweb/asm/commons/Remap\\*\\.class\"/>") (string-append "<include name=\"org/objectweb/asm/" "commons/Remap*.class\"/>" @@ -4181,9 +4181,15 @@ archives (jar).") ;; Failures "**/ComponentRealmCompositionTest.java" "**/PlexusContainerTest.java") - #:jdk ,icedtea-8 #:phases (modify-phases %standard-phases + (add-before 'build 'fix-google-collections + (lambda _ + ;; Google collections are now replaced with guava + (substitute* "plexus-container-default/pom.xml" + (("google-collections") "guava") + (("com.google.collections") "com.google.guava")) + #t)) (add-before 'build 'copy-resources (lambda _ (copy-recursively @@ -4198,7 +4204,9 @@ archives (jar).") dir "/plexus/component/composition/" "ComponentRealmCompositionTest.java") (("src/test") "plexus-container-default/src/test")) - #t)))))) + #t))) + (replace 'install + (install-from-pom "plexus-container-default/pom.xml"))))) (inputs `(("worldclass" ,java-plexus-classworlds) ("xbean" ,java-geronimo-xbean-reflect) @@ -4216,7 +4224,13 @@ archives (jar).") (arguments `(#:jar-name "plexus-component-annotations.jar" #:source-dir "plexus-component-annotations/src/main/java" - #:tests? #f)); no tests + #:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "plexus-component-annotations/pom.xml"))))) + (propagated-inputs + `(("java-plexus-containers-parent-pom" ,java-plexus-containers-parent-pom))) (inputs '()) (native-inputs '()) (synopsis "Plexus descriptors generator") @@ -4240,7 +4254,6 @@ from source tags and class annotations."))) (arguments `(#:jar-name "plexus-cipher.jar" #:source-dir "src/main/java" - #:jdk ,icedtea-8 #:tests? #f; FIXME: requires sisu-inject-bean #:phases (modify-phases %standard-phases @@ -4251,10 +4264,21 @@ from source tags and class annotations."))) (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named" (lambda _ (display "org.sonatype.plexus.components.cipher.DefaultPlexusCipher\n"))) - #t))))) + #t)) + (add-before 'install 'fix-test-dependency + (lambda _ + ;; sisu-inject-bean is only used for tests, but its scope is "provided". + (substitute* "pom.xml" + (("provided") "test")) + #t)) + (replace 'install (install-from-pom "pom.xml"))))) (inputs `(("java-cdi-api" ,java-cdi-api) ("java-javax-inject" ,java-javax-inject))) + (propagated-inputs + `(("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-15))) + (native-inputs + `(("java-junit" ,java-junit))) (home-page "https://github.com/sonatype/plexus-cipher") (synopsis "Encryption/decryption Component") (description "Plexus-cipher contains a component to deal with encryption @@ -4330,7 +4354,6 @@ Compiler component."))) (arguments `(#:jar-name "plexus-sec-dispatcher.jar" #:source-dir "src/main/java" - #:jdk ,icedtea-8 #:phases (modify-phases %standard-phases (add-before 'build 'generate-models @@ -4378,9 +4401,12 @@ Compiler component."))) (add-before 'check 'fix-paths (lambda _ (copy-recursively "src/test/resources" "target") - #t))))) - (inputs - `(("java-plexus-cipher" ,java-plexus-cipher))) + #t)) + (replace 'install (install-from-pom "pom.xml"))))) + (propagated-inputs + `(("java-plexus-utils" ,java-plexus-utils) + ("java-plexus-cipher" ,java-plexus-cipher) + ("java-sonatype-spice-parent-pom" ,java-sonatype-spice-parent-pom-12))) (native-inputs `(("java-modello-core" ,java-modello-core) ;; for modello: @@ -4708,10 +4734,19 @@ on the XPP3 API (XML Pull Parser)."))) (invoke "jar" "-cf" (string-append "dist/asm-" ,version ".jar") "-C" "output/build/tmp" "."))) + (add-before 'install 'fix-pom + (lambda _ + (substitute* (find-files "archive" "\\.pom$") + (("@product.artifact@") ,version)) + #t)) + (add-before 'install 'install-parent + (install-pom-file "archive/asm-parent.pom")) (replace 'install - (install-jars "dist"))))) + (install-from-pom "archive/asm.pom"))))) (native-inputs `(("java-junit" ,java-junit))) + (propagated-inputs + `(("java-org-ow2-parent-pom" ,java-org-ow2-parent-pom-1.3))) (home-page "https://asm.ow2.io/") (synopsis "Very small and fast Java bytecode manipulation framework") (description "ASM is an all purpose Java bytecode manipulation and @@ -4721,6 +4756,32 @@ transformations and analysis algorithms allow easily assembling custom complex transformations and code analysis tools.") (license license:bsd-3))) +(define java-org-ow2-parent-pom-1.3 + (package + (name "java-org-ow2-parent-pom") + (version "1.3") + (source (origin + (method url-fetch) + (uri "https://repo1.maven.org/maven2/org/ow2/ow2/1.3/ow2-1.3.pom") + (sha256 + (base32 + "1yr8hfx8gffpppa4ii6cvrsq029a6x8hzy7nsavxhs60s9kmq8ai")))) + (build-system ant-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'unpack) + (delete 'build) + (delete 'configure) + (replace 'install + (install-pom-file (assoc-ref %build-inputs "source")))))) + (home-page "https://ow2.org") + (synopsis "Ow2.org parent pom") + (description "This package contains the parent pom for projects from ow2.org, +including java-asm.") + (license license:lgpl2.1+))) + (define java-asm-bootstrap (package (inherit java-asm) @@ -5715,7 +5776,28 @@ bottlenecks move away from the database in an effectively cached system.") (arguments `(#:tests? #f ; no tests included #:jdk ,icedtea-8 - #:jar-name "jsr250.jar")) + #: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)) + (replace 'install + (install-from-pom "pom.xml"))))) (home-page "https://jcp.org/en/jsr/detail?id=250") (synopsis "Security-related annotations") (description "This package provides annotations for security. It provides @@ -7024,7 +7106,11 @@ logging framework for Java."))) (build-system ant-build-system) ;; TODO: javadoc (arguments - `(#:jar-name "commons-cli.jar")) + `(#:jar-name "commons-cli.jar" + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "pom.xml"))))) (native-inputs `(("java-junit" ,java-junit) ("java-hamcrest-core" ,java-hamcrest-core))) @@ -7197,8 +7283,12 @@ more efficient storage-wise than an uncompressed bitmap (as implemented in the (string-append "<include name=\"**/*Test.java\" />" "<exclude name=\"**/MultithreadedInitializationTest" ".java\" />"))) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "slf4j-api/pom.xml"))))) + (propagated-inputs + `(("java-slf4j-parent" ,java-slf4j-parent))) + (native-inputs `(("java-junit" ,java-junit) ("java-hamcrest-core" ,java-hamcrest-core))) (home-page "https://www.slf4j.org/") @@ -7210,6 +7300,21 @@ allowing the end user to plug in the desired logging framework at deployment time.") (license license:expat))) +(define java-slf4j-parent + (package + (inherit java-slf4j-api) + (name "java-slf4j-parent") + (native-inputs `()) + (propagated-inputs '()) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'build) + (delete 'configure) + (replace 'install + (install-pom-file "pom.xml"))))))) + (define-public java-slf4j-simple (package (name "java-slf4j-simple") @@ -7231,11 +7336,14 @@ time.") ;; ... and build test helper classes here: (apply invoke `("javac" "-d" "." - ,@(find-files "slf4j-api/src/test" ".*\\.java")))))))) - (inputs + ,@(find-files "slf4j-api/src/test" ".*\\.java"))))) + (replace 'install + (install-from-pom "slf4j-simple/pom.xml"))))) + (propagated-inputs + `(("java-slf4j-api" ,java-slf4j-api))) + (native-inputs `(("java-junit" ,java-junit) - ("java-hamcrest-core" ,java-hamcrest-core) - ("java-slf4j-api" ,java-slf4j-api))) + ("java-hamcrest-core" ,java-hamcrest-core))) (home-page "https://www.slf4j.org/") (synopsis "Simple implementation of simple logging facade for Java") (description "SLF4J binding for the Simple implementation, which outputs @@ -9522,11 +9630,7 @@ annotations.") (("org.apache-extras.beanshell") "org.beanshell")) #t)) (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((share (string-append (assoc-ref outputs "out") "/share/java"))) - (mkdir-p share) - (copy-file "dist/bsh-2.0b6.jar" (string-append share "/bsh-2.0b6.jar")) - #t)))))) + (install-from-pom "pom.xml"))))) (inputs `(("java-classpathx-servletapi" ,java-classpathx-servletapi) ("java-commons-bsf" ,java-commons-bsf))) @@ -10775,7 +10879,31 @@ sequences to format your console output which works on every platform.") (build-system ant-build-system) (arguments `(#:jar-name "java-jboss-el-api_spec.jar" - #:jdk ,icedtea-8)) + #: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)) + (replace 'install + (install-from-pom "pom.xml"))))) (inputs `(("java-junit" ,java-junit))) (home-page "https://github.com/jboss/jboss-el-api_spec") @@ -10804,7 +10932,33 @@ JavaServer Pages (JSP).") `(#:jar-name "java-jboss-interceptors-api_spec.jar" #:jdk ,icedtea-8 #:source-dir "." - #:tests? #f)); no tests + #: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, + ;; 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 "interceptor-api") + (groupId "javax.interceptor") + (artifactId "javax.interceptor-api") + (version "3.0"))))) + #t)) + (replace 'install + (install-from-pom "pom.xml"))))) (home-page "https://github.com/jboss/jboss-interceptors-api_spec") (synopsis "Interceptors 1.2 API classes from JSR 318") (description "Java-jboss-interceptors-api-spec implements the Interceptors @@ -10831,11 +10985,16 @@ specific events.") #:jar-name "java-cdi-api.jar" #:test-dir "api/src/test" #:jdk ,icedtea-8 - #:tests? #f)); Tests fail because we don't have a CDI provider yet - (inputs + #:tests? #f; Tests fail because we don't have a CDI provider yet + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "api/pom.xml"))))) + (propagated-inputs `(("java-javax-inject" ,java-javax-inject) ("java-jboss-el-api-spec" ,java-jboss-el-api-spec) - ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec))) + ("java-jboss-interceptors-api-spec" ,java-jboss-interceptors-api-spec) + ("java-weld-parent-pom" ,java-weld-parent-pom))) (native-inputs `(("java-testng" ,java-testng) ("java-hamcrest-core" ,java-hamcrest-core))) @@ -11825,22 +11984,27 @@ OSGi Service Registry is a goal of this project.") (substitute* "java/org/eclipse/sisu/plexus/DefaultPlexusContainerTest.java" (("resources/component-jar") "org.eclipse.sisu.plexus.tests/resources/component-jar"))) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "org.eclipse.sisu.plexus/pom.xml"))))) + (propagated-inputs `(("java-plexus-classworlds" ,java-plexus-classworlds) - ("java-plexus-util" ,java-plexus-utils) + ("java-plexus-utils" ,java-plexus-utils) ("java-plexus-component-annotations" ,java-plexus-component-annotations) - ("java-osgi-framework" ,java-osgi-framework) + ("java-cdi-api" ,java-cdi-api) ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) - ("java-guice" ,java-guice) - ("java-javax-inject" ,java-javax-inject) + ("java-sisu-plexus-parent-pom" ,java-sisu-plexus-parent-pom))) + (inputs + `(("java-osgi-framework" ,java-osgi-framework) ("java-slf4j-api" ,java-slf4j-api) - ("java-junit" ,java-junit))) - (native-inputs - `(("java-guava" ,java-guava) + ("java-javax-inject" ,java-javax-inject) + ("java-guice" ,java-guice) + ("java-guava" ,java-guava) ("java-aopalliance" ,java-aopalliance) - ("java-cglib" ,java-cglib) - ("java-asm" ,java-asm))) + ("java-asm" ,java-asm) + ("java-cglib" ,java-cglib))) + (native-inputs + `(("java-junit" ,java-junit))) (home-page "https://www.eclipse.org/sisu/") (synopsis "Plexus support for the sisu container") (description "Sisu is a modular JSR330-based container that supports @@ -11848,6 +12012,21 @@ classpath scanning, auto-binding, and dynamic auto-wiring. This package adds Plexus support to the Sisu-Inject container.") (license license:epl1.0))) +(define java-sisu-plexus-parent-pom + (package + (inherit java-eclipse-sisu-plexus) + (name "java-sisu-plexus-parent-pom") + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (install-pom-file "pom.xml"))))) + (propagated-inputs + `(("java-sonatype-oss-parent-pom-9" ,java-sonatype-oss-parent-pom-9))))) + (define-public java-commons-compiler (package (name "java-commons-compiler") diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm index 683aabf2de..dfd7102e1e 100644 --- a/gnu/packages/maven.scm +++ b/gnu/packages/maven.scm @@ -96,7 +96,11 @@ provides the Maven plugin generating the component metadata."))) (arguments `(#:jar-name "maven-resolver-api.jar" #:source-dir "maven-resolver-api/src/main/java" - #:test-dir "maven-resolver-api/src/test")) + #:test-dir "maven-resolver-api/src/test" + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "maven-resolver-api/pom.xml"))))) (native-inputs `(("java-asm" ,java-asm) ("java-cglib" ,java-cglib) @@ -104,11 +108,32 @@ provides the Maven plugin generating the component metadata."))) ("java-junit" ,java-junit) ("java-mockito-1" ,java-mockito-1) ("java-objenesis" ,java-objenesis))) + (propagated-inputs + `(("maven-resolver-parent-pom" ,maven-resolver-parent-pom))) (home-page "https://github.com/apache/maven-resolver") (synopsis "Maven repository system API") (description "This package contains the API for the maven repository system.") (license license:asl2.0))) +(define maven-resolver-parent-pom + (package + (inherit maven-resolver-api) + (name "maven-resolver-parent-pom") + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (add-before 'install 'fix-pom + (lambda _ + (substitute* "pom.xml" + (("<classifier>no_aop</classifier>") "")) + #t)) + (replace 'install + (install-pom-file "pom.xml"))))) + (propagated-inputs '()))) + (define-public maven-resolver-spi (package (inherit maven-resolver-api) @@ -117,8 +142,11 @@ provides the Maven plugin generating the component metadata."))) `(#:jar-name "maven-resolver-spi.jar" #:source-dir "maven-resolver-spi/src/main/java" #:test-dir "maven-resolver-spi/src/test" - #:jdk ,icedtea-8)) - (inputs + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "maven-resolver-spi/pom.xml"))))) + (propagated-inputs `(("maven-resolver-api" ,maven-resolver-api))) (synopsis "Maven repository system SPI") (description "This package contains the service provider interface (SPI) @@ -148,8 +176,11 @@ ease testing of the repository system."))) `(#:jar-name "maven-resolver-util.jar" #:source-dir "maven-resolver-util/src/main/java" #:test-dir "maven-resolver-util/src/test" - #:jdk ,icedtea-8)) - (inputs + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "maven-resolver-util/pom.xml"))))) + (propagated-inputs `(("maven-resolver-api" ,maven-resolver-api))) (native-inputs `(("java-junit" ,java-junit) @@ -176,16 +207,17 @@ ease usage of the repository system."))) (with-output-to-file "build/classes/META-INF/sisu/javax.inject.Named" (lambda _ (display "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory\n"))) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "maven-resolver-connector-basic/pom.xml"))))) + (propagated-inputs `(("maven-resolver-api" ,maven-resolver-api) ("maven-resolver-spi" ,maven-resolver-spi) ("maven-resolver-util" ,maven-resolver-util) - ("java-javax-inject" ,java-javax-inject) ("java-slf4j-api" ,java-slf4j-api))) (native-inputs - `(("java-junit" ,java-junit) - ("java-hamcrest-core" ,java-hamcrest-core) + `(("java-javax-inject" ,java-javax-inject) + ("java-junit" ,java-junit) ("maven-resolver-test-util" ,maven-resolver-test-util))) (synopsis "Maven repository connector implementation") (description "This package contains a repository connector implementation @@ -199,7 +231,6 @@ for repositories using URI-based layouts."))) `(#:jar-name "maven-resolver-impl.jar" #:source-dir "maven-resolver-impl/src/main/java" #:test-dir "maven-resolver-impl/src/test" - #:jdk ,icedtea-8 #:phases (modify-phases %standard-phases (add-before 'build 'generate-sisu @@ -233,22 +264,20 @@ for repositories using URI-based layouts."))) "org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory\n" "org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory\n" "org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory")))) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "maven-resolver-impl/pom.xml"))))) + (propagated-inputs `(("maven-resolver-api" ,maven-resolver-api) ("maven-resolver-spi" ,maven-resolver-spi) ("maven-resolver-util" ,maven-resolver-util) ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) ("java-javax-inject" ,java-javax-inject) ("java-guice" ,java-guice) - ("java-guava" ,java-guava) - ("java-cglib" ,java-cglib) - ("java-asm" ,java-asm) - ("jajva-aopalliance" ,java-aopalliance) - ("java-slf4j-api" ,java-slf4j-api))) + ("java-slf4j-api" ,java-slf4j-api) + ("maven-resolver-parent-pom" ,maven-resolver-parent-pom))) (native-inputs `(("java-junit" ,java-junit) - ("java-hamcrest-core" ,java-hamcrest-core) ("maven-resolver-test-util" ,maven-resolver-test-util))))) (define-public maven-resolver-transport-wagon @@ -357,12 +386,15 @@ Maven Wagon, for use in Maven."))) (lambda _ (delete-file "src/test/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractorTest.java") - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "pom.xml"))))) + (propagated-inputs `(("java-jansi" ,java-jansi) ("java-commons-io" ,java-commons-io) ("java-jsr305" ,java-jsr305) - ("java-plexus-container-default" ,java-plexus-container-default))) + ("java-plexus-container-default" ,java-plexus-container-default) + ("maven-parent-pom-30" ,maven-parent-pom-30))) (native-inputs `(("unzip" ,unzip) ("java-junit" ,java-junit) @@ -405,7 +437,7 @@ replacement with improvements.") (version "3.3.4") (source (origin (method url-fetch) - (uri (string-append "mirror://apache/maven/wagon/" + (uri (string-append "https://archive.apache.org/dist/maven/wagon/" "wagon-" version "-source-release.zip")) (sha256 (base32 @@ -710,9 +742,9 @@ artifact and repository handling code. It uses providers, that are tools to manage artifacts and deployment. This package contains a Wagon provider that gets and puts artifacts through HTTP(S) using Apache HttpClient-4.x."))) -(define-public maven-artifact +(define maven-pom (package - (name "maven-artifact") + (name "maven-pom") (version "3.6.1") (source (origin (method url-fetch) @@ -730,23 +762,100 @@ gets and puts artifacts through HTTP(S) using Apache HttpClient-4.x."))) "maven-generate-javax-inject-named.patch")))) (build-system ant-build-system) (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (add-before 'install 'fix-dependencies + (lambda _ + (substitute* "pom.xml" + (("classWorldsVersion>.*") + (string-append + "classWorldsVersion>" + ,(package-version java-plexus-classworlds) + "</classWorldsVersion>\n")) + (("commonsCliVersion>.*") + (string-append + "commonsCliVersion>" + ,(package-version java-commons-cli) + "</commonsCliVersion>\n")) + (("commonsLangVersion>.*") + (string-append + "commonsLangVersion>" + ,(package-version java-commons-lang3) + "</commonsLangVersion>\n")) + (("plexusUtilsVersion>.*") + (string-append + "plexusUtilsVersion>" + ,(package-version java-plexus-utils) + "</plexusUtilsVersion>\n")) + (("plexusInterpolationVersion>.*") + (string-append + "plexusInterpolationVersion>" + ,(package-version java-plexus-interpolation) + "</plexusInterpolationVersion>\n")) + (("guiceVersion>.*") + (string-append + "guiceVersion>" + ,(package-version java-guice) + "</guiceVersion>\n")) + (("sisuInjectVersion>.*") + (string-append + "sisuInjectVersion>" + ,(package-version java-eclipse-sisu-inject) + "</sisuInjectVersion>\n")) + (("securityDispatcherVersion>.*") + (string-append + "securityDispatcherVersion>" + ,(package-version java-plexus-sec-dispatcher) + "</securityDispatcherVersion>\n")) + (("cipherVersion>.*") + (string-append + "cipherVersion>" + ,(package-version java-plexus-cipher) + "</cipherVersion>\n")) + (("slf4jVersion>.*") + (string-append + "slf4jVersion>" + ,(package-version java-slf4j-api) + "</slf4jVersion>\n")) + (("<classifier>no_aop</classifier>") "")) + #t)) + (replace 'install + (install-pom-file "pom.xml"))))) + (propagated-inputs + `(("maven-parent-pom-33" ,maven-parent-pom-33))) + (home-page "https://maven.apache.org/") + (synopsis "Build system") + (description "Apache Maven is a software project management and comprehension +tool. This package contains the Maven pom file, used by all maven components.") + (license license:asl2.0))) + +(define-public maven-artifact + (package + (inherit maven-pom) + (name "maven-artifact") + (arguments `(#:jar-name "maven-artifact.jar" #:source-dir "maven-artifact/src/main/java" #:test-dir "maven-artifact/src/test" - #:main-class "org.apache.maven.artifact.versioning.ComparableVersion")) - (inputs + #:main-class "org.apache.maven.artifact.versioning.ComparableVersion" + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "maven-artifact/pom.xml"))))) + (propagated-inputs `(("java-plexus-utils" ,java-plexus-utils) - ("java-commons-lang3" ,java-commons-lang3))) + ("java-commons-lang3" ,java-commons-lang3) + ("maven-pom" ,maven-pom))) (native-inputs `(("java-junit" ,java-junit))) - (home-page "https://maven.apache.org/") - (synopsis "Build system") (description "Apache Maven is a software project management and comprehension tool. This package contains the Maven Artifact classes, providing the @code{Artifact} interface, with its @code{DefaultArtifact} implementation. The jar file is executable and provides a little tool to display how Maven parses -and compares versions:") - (license license:asl2.0))) +and compares versions:"))) (define-public maven-model (package @@ -756,7 +865,6 @@ and compares versions:") `(#:jar-name "maven-model.jar" #:source-dir "maven-model/src/main/java" #:test-dir "maven-model/src/test" - #:jdk ,icedtea-8 #:phases (modify-phases %standard-phases (add-before 'build 'generate-models @@ -770,10 +878,12 @@ and compares versions:") (modello-single-mode file "4.0.0" "xpp3-reader") (modello-single-mode file "4.0.0" "xpp3-writer") (modello-single-mode file "4.0.0" "xpp3-extended-reader")) - #t))))) - (inputs + #t)) + (replace 'install (install-from-pom "maven-model/pom.xml"))))) + (propagated-inputs `(("java-commons-lang3" ,java-commons-lang3) - ("java-plexus-utils" ,java-plexus-utils))) + ("java-plexus-utils" ,java-plexus-utils) + ("maven-pom" ,maven-pom))) (native-inputs `(("java-modello-core" ,java-modello-core) ;; for modello: @@ -816,13 +926,12 @@ so really just plain Java objects."))) '("org/apache/maven/building/FileSourceTest.java" "org/apache/maven/building/UrlSourceTest.java") (("target/test-classes") "maven-builder-support/src/test/resources"))) - #t))))) - (inputs - `(("java-plexus-utils" ,java-plexus-utils) - ("java-commons-lang3" ,java-commons-lang3))) + #t)) + (replace 'install (install-from-pom "maven-builder-support/pom.xml"))))) + (propagated-inputs + `(("maven-pom" ,maven-pom))) (native-inputs - `(("java-junit" ,java-junit) - ("java-hamcrest-core" ,java-hamcrest-core))) + `(("java-junit" ,java-junit))) (description "Apache Maven is a software project management and comprehension tool. This package contains a support library for descriptor builders (model, setting, toolchains)"))) @@ -834,7 +943,6 @@ setting, toolchains)"))) (arguments `(#:jar-name "maven-settings.jar" #:source-dir "maven-settings/src/main/java" - #:jdk ,icedtea-8 #:tests? #f; no tests #:phases (modify-phases %standard-phases @@ -848,8 +956,11 @@ setting, toolchains)"))) (modello-single-mode file "1.1.0" "java") (modello-single-mode file "1.1.0" "xpp3-reader") (modello-single-mode file "1.1.0" "xpp3-writer")) - #t))))) - (inputs '()) + #t)) + (replace 'install (install-from-pom "maven-settings/pom.xml"))))) + (propagated-inputs + `(("java-plexus-utils" ,java-plexus-utils) + ("maven-pom" ,maven-pom))) (native-inputs `(("java-modello-core" ,java-modello-core) ;; for modello: @@ -891,17 +1002,18 @@ simply plain java objects."))) (chmod "components.sh" #o755) (invoke "./components.sh" "maven-settings-builder/src/main/java" "build/classes/META-INF/plexus/components.xml") - #t))))) - (inputs + #t)) + (replace 'install (install-from-pom "maven-settings-builder/pom.xml"))))) + (propagated-inputs `(("java-plexus-utils" ,java-plexus-utils) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) ("java-plexus-interpolation" ,java-plexus-interpolation) ("java-plexus-sec-dispatcher" ,java-plexus-sec-dispatcher) ("maven-builder-support" ,maven-builder-support) ("maven-settings" ,maven-settings) - ("java-commons-lang3" ,java-commons-lang3))) + ("maven-pom" ,maven-pom))) (native-inputs - `(("java-junit" ,java-junit))) + `(("java-junit" ,java-junit) + ("java-plexus-component-annotations" ,java-plexus-component-annotations))) (description "Apache Maven is a software project management and comprehension tool. This package contains the effective model builder, with profile activation, inheritance, interpolation, @dots{}"))) @@ -933,19 +1045,19 @@ inheritance, interpolation, @dots{}"))) (lambda _ (substitute* (find-files "maven-model-builder/src/test/java" ".*.java") (("src/test") "maven-model-builder/src/test")) - #t))))) - (inputs - `(("model" ,maven-model) - ("artifact" ,maven-artifact) - ("support" ,maven-builder-support) - ("annotations" ,java-plexus-component-annotations) - ("utils" ,java-plexus-utils) - ("interpolation" ,java-plexus-interpolation) - ("lang3" ,java-commons-lang3) - ("guava" ,java-guava))) + #t)) + (replace 'install + (install-from-pom "maven-model-builder/pom.xml"))))) + (propagated-inputs + `(("java-plexus-interpolation" ,java-plexus-interpolation) + ("java-plexus-utils" ,java-plexus-utils) + ("maven-artifact" ,maven-artifact) + ("maven-builder-support" ,maven-builder-support) + ("maven-model" ,maven-model) + ("maven-pom" ,maven-pom))) (native-inputs `(("java-junit" ,java-junit) - ("java-hamcrest-core" ,java-hamcrest-core) + ("java-guava" ,java-guava) ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus) ("java-plexus-component-annotations" ,java-plexus-component-annotations) ("guice" ,java-guice) @@ -982,8 +1094,12 @@ inheritance, interpolation, @dots{}"))) (modello-single-mode file "1.1.0" "java") (modello-single-mode file "1.1.0" "xpp3-reader") (modello-single-mode file "1.1.0" "xpp3-writer")) - #t))))) - (inputs '()) + #t)) + (replace 'install + (install-from-pom "maven-repository-metadata/pom.xml"))))) + (propagated-inputs + `(("java-plexus-utils" ,java-plexus-utils) + ("maven-pom" ,maven-pom))) (native-inputs `(("modello" ,java-modello-core) ;; for modello: @@ -1025,22 +1141,21 @@ so really just plain objects."))) (chmod "./sisu.sh" #o755) (invoke "./sisu.sh" "maven-resolver-provider/src/main/java" "build/classes/META-INF/sisu/javax.inject.Named") - #t))))) - (inputs - `(("maven-resolver-spi" ,maven-resolver-spi) + #t)) + (replace 'install + (install-from-pom "maven-resolver-provider/pom.xml"))))) + (propagated-inputs + `(("maven-model" ,maven-model) + ("maven-model-builder" ,maven-model-builder) + ("maven-resolver-spi" ,maven-resolver-spi) ("maven-resolver-api" ,maven-resolver-api) ("maven-resolver-impl" ,maven-resolver-impl) ("maven-resolver-util" ,maven-resolver-util) - ("maven-model" ,maven-model) - ("maven-model-builder" ,maven-model-builder) ("maven-builder-support" ,maven-builder-support) ("maven-repository-metadata" ,maven-repository-metadata) ("java-plexus-utils" ,java-plexus-utils) ("java-plexus-component-annotations" ,java-plexus-component-annotations) - ("java-commons-lang3" ,java-commons-lang3) ("java-guice" ,java-guice) - ("java-guava" ,java-guava) - ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) ("java-javax-inject" ,java-javax-inject))))) (define-public maven-plugin-api @@ -1064,8 +1179,10 @@ so really just plain objects."))) (modello-single-mode file "1.0.0" "java") (modello-single-mode file "1.0.0" "xpp3-reader") (modello-single-mode file "1.0.0" "xpp3-writer")) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "maven-plugin-api/pom.xml"))))) + (propagated-inputs `(("maven-artifact" ,maven-artifact) ("maven-model" ,maven-model) ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus) @@ -1147,8 +1264,15 @@ generally generated from plugin sources using maven-plugin-plugin."))) (modello-single-mode file "1.1.0" "java") (modello-single-mode file "1.1.0" "xpp3-reader") (modello-single-mode file "1.1.0" "xpp3-writer")) - #t))))) - (inputs + #t)) + (add-before 'install 'fix-pom + (lambda _ + (substitute* "pom.xml" + (("<classifier>no_aop</classifier>") "")) + #t)) + (replace 'install + (install-from-pom "pom.xml"))))) + (propagated-inputs `(("maven-artifact" ,maven-artifact) ("maven-resolver-provider" ,maven-resolver-provider) ("maven-builder-support" ,maven-builder-support) @@ -1306,8 +1430,10 @@ artifactId=maven-core" ,(package-version maven-core-bootstrap)))) (substitute* "build.xml" (("srcdir=\"maven-embedder/src/test\"") "srcdir=\"maven-embedder/src/test/java\"")) - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "maven-embedder/pom.xml"))))) + (propagated-inputs `(("maven-core" ,maven-core) ("maven-artifact" ,maven-artifact) ("maven-plugin-api" ,maven-plugin-api) @@ -1334,7 +1460,8 @@ artifactId=maven-core" ,(package-version maven-core-bootstrap)))) ("java-guice" ,java-guice) ("java-javax-inject" ,java-javax-inject) ("java-slf4j-api" ,java-slf4j-api) - ("java-slf4j-simple" ,java-slf4j-simple))) + ("java-slf4j-simple" ,java-slf4j-simple) + ("java-jsr250" ,java-jsr250))) (native-inputs `(("java-modello-core" ,java-modello-core) ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect) @@ -1503,8 +1630,10 @@ logging support."))) (add-after 'generate-metadata 'rebuild (lambda _ (invoke "ant" "jar") - #t))))) - (inputs + #t)) + (replace 'install + (install-from-pom "pom.xml"))))) + (propagated-inputs `(("maven-artifact" ,maven-artifact) ("maven-repository-metadata" ,maven-repository-metadata) ("maven-builder-support" ,maven-builder-support) @@ -1584,8 +1713,10 @@ layer for plugins that need to keep Maven2 compatibility."))) ;; Reference every jar so plexus-classworlds can find them. (for-each (lambda (dependency) - (format #t "load ~a/share/java/*.jar~%" - (assoc-ref inputs dependency))) + (for-each + (lambda (file) + (format #t "load ~a~%" file)) + (find-files (assoc-ref inputs dependency) ".*.jar$"))) '("maven-artifact" "maven-embedder" "maven-core" "maven-compat" "maven-builder-support" "maven-model" "maven-model-builder" "maven-settings" "maven-settings-builder" "maven-plugin-api" |