From patchwork Tue Dec 21 22:45:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 35557 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B7F5827BBEA; Tue, 21 Dec 2021 22:47:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED,URI_NOVOWEL autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B017127BBE9 for ; Tue, 21 Dec 2021 22:47:18 +0000 (GMT) Received: from localhost ([::1]:41296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mznuf-0002xc-Pj for patchwork@mira.cbaines.net; Tue, 21 Dec 2021 17:47:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzntZ-00006N-Q3 for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzntZ-0001gt-Gf for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzntZ-00082M-Fx for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:09 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52723] [PATCH 16/26] gnu: java-plexus-container-default-bootstrap: Update to 2.1.0. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 22:46:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52723 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52723@debbugs.gnu.org Received: via spool by 52723-submit@debbugs.gnu.org id=B52723.164012675230696 (code B ref 52723); Tue, 21 Dec 2021 22:46:09 +0000 Received: (at 52723) by debbugs.gnu.org; 21 Dec 2021 22:45:52 +0000 Received: from localhost ([127.0.0.1]:56048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzntH-0007yv-Bh for submit@debbugs.gnu.org; Tue, 21 Dec 2021 17:45:52 -0500 Received: from lepiller.eu ([89.234.186.109]:52554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mznsw-0007ve-02 for 52723@debbugs.gnu.org; Tue, 21 Dec 2021 17:45:32 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 01fde9fc for <52723@debbugs.gnu.org>; Tue, 21 Dec 2021 22:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=KI7AMiKeNEutb6vgOM7X5TgmO zzD5aeHliY5YVOeEPI=; b=aTGaYrslWh0C64BgkFu65TqPqEQhV+NgKb49BRMt/ zAtlGmxo1ttUG+A7UZNRpNBMNP44U3425rwjHXG4bT8IgcmSa6kKh5IGmKudxBbr iaGEUzTyzs0EKnhM/J4n7Hn0uwGYtih5m+XxrjC4QUAdIvInuv1sIICfio8RI3g9 ewtc2D2Kmiz8vqKIdehMqF4M9A3Z/FZYqLHH7znFAQcVUDR8wxDtvgL5b9kjZSqL nOVx1W2RWW1o7VZLoNQyCGXYpt44c2H3vb+21QlsAdxCx9Uqz8slv+P4PWBdsEpz c6S9xnT5cl+kmGAaMwLYHSi0gK1Vo8JGPwpFvu2zo6n7Q== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1e5cd5c4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <52723@debbugs.gnu.org>; Tue, 21 Dec 2021 22:45:25 +0000 (UTC) From: Julien Lepiller Date: Tue, 21 Dec 2021 23:45:00 +0100 Message-Id: X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211221234231.44299f63@tachikoma.lepiller.eu> References: <20211221234231.44299f63@tachikoma.lepiller.eu> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/java.scm (java-plexus-container-default-bootstrap): Update to 2.1.0. (java-plexus-container-default-1.7, java-plexus-containers-parent-pom-1.7) (java-plexus-component-annotations-1.7, java-plexus-component-metadata-1.7): New variables. --- gnu/packages/java.scm | 188 +++++++++++++++++++++++++++++++++++++++-- gnu/packages/maven.scm | 22 ++--- 2 files changed, 191 insertions(+), 19 deletions(-) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index af36d9e10f..463cf51bcb 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -4417,7 +4417,7 @@ (define-public java-plexus-classworlds (define java-plexus-container-default-bootstrap (package (name "java-plexus-container-default-bootstrap") - (version "1.7.1") + (version "2.1.0") (source (origin (method git-fetch) (uri (git-reference @@ -4426,7 +4426,7 @@ (define java-plexus-container-default-bootstrap (file-name (git-file-name name version)) (sha256 (base32 - "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228")))) + "0r9yq67c1hvi1pz5wmx6x6hk5fmavp8a7yal3j5hkaad757firn1")))) (build-system ant-build-system) (arguments `(#:jar-name "container-default.jar" @@ -4673,7 +4673,82 @@ (define-public java-plexus-component-metadata (lambda _ (copy-recursively "src/main/resources" "build/classes/") - #t))))) + #t)) + (add-before 'build 'reinstate-cli + ;; The CLI was removed in 2.1.0, but we still need it to build some + ;; maven dependencies, and some parts of maven itself. We can't use + ;; the maven plugin for that yet. + (lambda _ + (with-output-to-file "src/main/java/org/codehaus/plexus/metadata/PlexusMetadataGeneratorCli.java" + (lambda _ + ;; Copied from a previous version of this package. + (display "package org.codehaus.plexus.metadata; + +import java.io.File; +import java.util.Arrays; +import java.util.Collections; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.OptionBuilder; +import org.apache.commons.cli.Options; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.tools.cli.AbstractCli; + +public class PlexusMetadataGeneratorCli + extends AbstractCli +{ + public static final char SOURCE_DIRECTORY = 's'; + public static final char SOURCE_ENCODING = 'e'; + public static final char CLASSES_DIRECTORY = 'c'; + public static final char OUTPUT_FILE = 'o'; + public static final char DESCRIPTORS_DIRECTORY = 'm'; + + public static void main( String[] args ) + throws Exception + { + new PlexusMetadataGeneratorCli().execute( args ); + } + + @Override + public String getPomPropertiesPath() + { + return \"META-INF/maven/org.codehaus.plexus/plexus-metadata-generator/pom.properties\"; + } + + @Override + @SuppressWarnings(\"static-access\") + public Options buildCliOptions( Options options ) + { + options.addOption( OptionBuilder.withLongOpt( \"source\" ).hasArg().withDescription( \"Source directory.\" ).create( SOURCE_DIRECTORY ) ); + options.addOption( OptionBuilder.withLongOpt( \"encoding\" ).hasArg().withDescription( \"Source file encoding.\" ).create( SOURCE_ENCODING ) ); + options.addOption( OptionBuilder.withLongOpt( \"classes\" ).hasArg().withDescription( \"Classes directory.\" ).create( CLASSES_DIRECTORY ) ); + options.addOption( OptionBuilder.withLongOpt( \"output\" ).hasArg().withDescription( \"Output directory.\" ).create( OUTPUT_FILE ) ); + options.addOption( OptionBuilder.withLongOpt( \"descriptors\" ).hasArg().withDescription( \"Descriptors directory.\" ).create( DESCRIPTORS_DIRECTORY ) ); + return options; + } + + public void invokePlexusComponent( CommandLine cli, PlexusContainer plexus ) + throws Exception + { + MetadataGenerator metadataGenerator = plexus.lookup( MetadataGenerator.class ); + + MetadataGenerationRequest request = new MetadataGenerationRequest(); + request.classesDirectory = new File( cli.getOptionValue( CLASSES_DIRECTORY ) ); + request.classpath = Collections.emptyList(); + request.sourceDirectories = Arrays.asList( new String[]{ new File( cli.getOptionValue( SOURCE_DIRECTORY ) ).getAbsolutePath() } ); + request.sourceEncoding = cli.getOptionValue( SOURCE_ENCODING ); + request.useContextClassLoader = true; + request.outputFile = new File( cli.getOptionValue( OUTPUT_FILE ) ); + request.componentDescriptorDirectory = new File( cli.getOptionValue( DESCRIPTORS_DIRECTORY ) ); + + metadataGenerator.generateDescriptor( request ); + } +}"))))) + (add-before 'check 'fix-test-location + (lambda _ + (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java" + "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java") + (("target") "build"))))))) (propagated-inputs `(("java-plexus-container-default" ,java-plexus-container-default) ("java-plexu-component-annotations" ,java-plexus-component-annotations) @@ -4687,7 +4762,104 @@ (define-public java-plexus-component-metadata ("java-commons-cli" ,java-commons-cli) ("java-qdox" ,java-qdox) ("java-jdom2" ,java-jdom2) - ("java-asm" ,java-asm))) + ("java-asm-8" ,java-asm-8))) + (native-inputs + (list java-junit java-guava java-geronimo-xbean-reflect)) + (synopsis "Inversion-of-control container for Maven") + (description "The Plexus project provides a full software stack for creating +and executing software projects. Based on the Plexus container, the +applications can utilise component-oriented programming to build modular, +reusable components that can easily be assembled and reused. This package +provides the Maven plugin generating the component metadata."))) + +(define-public java-plexus-container-default-1.7 + (package + (inherit java-plexus-container-default) + (version "1.7.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/codehaus-plexus/plexus-containers") + (commit (string-append "plexus-containers-" version)))) + (file-name (git-file-name "java-plexus-container-default" version)) + (sha256 + (base32 + "1316hrp5vqfv0aw7miq2fp0wwy833h66h502h29vnh5sxj27x228")))))) + +(define java-plexus-containers-parent-pom-1.7 + (package + (inherit java-plexus-container-default-1.7) + (name "java-plexus-containers-parent-pom") + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (install-pom-file "pom.xml"))))) + (propagated-inputs + `(("plexus-parent-pom" ,plexus-parent-pom-4.0))))) + +(define-public java-plexus-component-annotations-1.7 + (package + (inherit java-plexus-container-default-1.7) + (name "java-plexus-component-annotations") + (arguments + `(#:jar-name "plexus-component-annotations.jar" + #:source-dir "plexus-component-annotations/src/main/java" + #: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-1.7" ,java-plexus-containers-parent-pom-1.7))) + (inputs '()) + (native-inputs '()) + (synopsis "Plexus descriptors generator") + (description "This package is a Maven plugin to generate Plexus descriptors +from source tags and class annotations."))) + +(define-public java-plexus-component-metadata-1.7 + (package + (inherit java-plexus-container-default-1.7) + (name "java-plexus-component-metadata") + (arguments + `(#:jar-name "plexus-component-metadata.jar" + #:source-dir "src/main/java" + #:test-dir "src/test" + #:phases + (modify-phases %standard-phases + (add-before 'configure 'chdir + (lambda _ + (chdir "plexus-component-metadata") + #t)) + (add-before 'build 'copy-resources + (lambda _ + (copy-recursively "src/main/resources" + "build/classes/") + #t)) + (add-before 'check 'fix-test-location + (lambda _ + (substitute* '("src/test/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriterTest.java" + "src/test/java/org/codehaus/plexus/metadata/merge/ComponentsXmlMergerTest.java") + (("target") "build"))))))) + (propagated-inputs + (list java-plexus-container-default-1.7 + java-plexus-component-annotations-1.7 + java-plexus-utils + java-plexus-cli + java-plexus-cli + java-plexus-classworlds + maven-plugin-api + maven-plugin-annotations + maven-core-bootstrap + maven-model + java-commons-cli + java-qdox + java-jdom2 + java-asm)) (native-inputs (list java-junit java-guava java-geronimo-xbean-reflect)) (synopsis "Inversion-of-control container for Maven") @@ -4820,9 +4992,9 @@ (define-public java-plexus-java (list java-asm java-qdox-2-M9 java-javax-inject plexus-parent-pom-4.0)) (inputs - (list java-plexus-component-annotations)) + (list java-plexus-component-annotations-1.7)) (native-inputs - (list java-plexus-component-metadata java-junit)) + (list java-plexus-component-metadata-1.7 java-junit)) (home-page "https://codehaus-plexus.github.io/plexus-languages/plexus-java") (synopsis "Shared language features for Java") (description "This package contains shared language features of the Java @@ -4939,9 +5111,9 @@ (define-public java-plexus-compiler-manager (install-from-pom "plexus-compiler-manager/pom.xml"))))) (propagated-inputs (list java-plexus-compiler-api java-plexus-compiler-pom - java-plexus-container-default)) + java-plexus-container-default-1.7)) (native-inputs - (list unzip java-plexus-component-metadata)) + (list unzip java-plexus-component-metadata-1.7)) (synopsis "Compiler management for Plexus Compiler component") (description "Plexus Compiler is a Plexus component to use different compilers through a uniform API. This component chooses the compiler diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm index 1be266f9a7..e62db6cb85 100644 --- a/gnu/packages/maven.scm +++ b/gnu/packages/maven.scm @@ -293,7 +293,7 @@ (define-public maven-resolver-transport-wagon ("maven-resolver-util" ,maven-resolver-util) ("java-javax-inject" ,java-javax-inject) ("mavne-wagon-provider-api" ,maven-wagon-provider-api) - ("java-plexus-component-annotation" ,java-plexus-component-annotations) + ("java-plexus-component-annotation" ,java-plexus-component-annotations-1.7) ("java-plexus-classworld" ,java-plexus-classworlds) ("java-plexus-plexus-util" ,java-plexus-utils) ("java-slf4j-api" ,java-slf4j-api) @@ -735,8 +735,8 @@ (define-public maven-wagon-file (list java-plexus-utils maven-wagon-provider-api)) (native-inputs `(("maven-wagon-provider-test" ,maven-wagon-provider-test) - ("java-plexus-component-metadata" ,java-plexus-component-metadata) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) + ("java-plexus-component-metadata" ,java-plexus-component-metadata-1.7) + ("java-plexus-component-annotations" ,java-plexus-component-annotations-1.7) ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus) ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) ("java-plexus-classworlds" ,java-plexus-classworlds) @@ -823,8 +823,8 @@ (define-public maven-wagon-http-shared maven-wagon-provider-api)) (native-inputs `(("maven-wagon-provider-test" ,maven-wagon-provider-test) - ("java-plexus-component-metadata" ,java-plexus-component-metadata) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) + ("java-plexus-component-metadata" ,java-plexus-component-metadata-1.7) + ("java-plexus-component-annotations" ,java-plexus-component-annotations-1.7) ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus) ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) ("java-plexus-classworlds" ,java-plexus-classworlds) @@ -895,8 +895,8 @@ (define-public maven-wagon-http maven-wagon-provider-api)) (native-inputs `(("maven-wagon-provider-test" ,maven-wagon-provider-test) - ("java-plexus-component-metadata" ,java-plexus-component-metadata) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) + ("java-plexus-component-metadata" ,java-plexus-component-metadata-1.7) + ("java-plexus-component-annotations" ,java-plexus-component-annotations-1.7) ("java-eclipse-sisu-plexus" ,java-eclipse-sisu-plexus) ("java-plexus-container-default" ,java-plexus-container-default) ("java-eclipse-sisu-inject" ,java-eclipse-sisu-inject) @@ -1472,7 +1472,7 @@ (define-public maven-core-bootstrap ("maven-plugin-api" ,maven-plugin-api) ("maven-repository-metadata" ,maven-repository-metadata) ("maven-shared-utils" ,maven-shared-utils) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) + ("java-plexus-component-annotations" ,java-plexus-component-annotations-1.7) ("java-plexus-utils" ,java-plexus-utils) ("java-commons-lang3" ,java-commons-lang3) ("java-guava" ,java-guava) @@ -1590,7 +1590,7 @@ (define-public maven-core (invoke "ant" "jar") #t)))))) (native-inputs - `(("java-plexus-component-metadata" ,java-plexus-component-metadata) + `(("java-plexus-component-metadata" ,java-plexus-component-metadata-1.7) ("java-commons-cli" ,java-commons-cli) ("java-plexus-cli" ,java-plexus-cli) ("java-jdom2" ,java-jdom2) @@ -1867,7 +1867,7 @@ (define-public maven-compat (native-inputs `(("java-modello-core" ,java-modello-core) ("java-plexus-utils" ,java-plexus-utils) - ("java-plexus-component-annotations" ,java-plexus-component-annotations) + ("java-plexus-component-annotations" ,java-plexus-component-annotations-1.7) ("java-plexus-classworlds" ,java-plexus-classworlds) ("java-geronimo-xbean-reflect" ,java-geronimo-xbean-reflect) ("java-plexus-build-api" ,java-plexus-build-api) @@ -1882,7 +1882,7 @@ (define-public maven-compat ("java-modello-plugins-xml" ,java-modello-plugins-xml) ("java-modello-plugins-xpp3" ,java-modello-plugins-xpp3) ;; metadata - ("java-plexus-component-metadata" ,java-plexus-component-metadata) + ("java-plexus-component-metadata" ,java-plexus-component-metadata-1.7) ("java-commons-cli" ,java-commons-cli) ("java-plexus-cli" ,java-plexus-cli) ("java-jdom2" ,java-jdom2)