unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: 52723@debbugs.gnu.org
Subject: [bug#52723] [PATCH 16/26] gnu: java-plexus-container-default-bootstrap: Update to 2.1.0.
Date: Tue, 21 Dec 2021 23:45:00 +0100	[thread overview]
Message-ID: <b41febe67ce9bbb5965a483486b5d748e9871ebc.1640126679.git.julien@lepiller.eu> (raw)
In-Reply-To: <20211221234231.44299f63@tachikoma.lepiller.eu>

* 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)
-- 
2.34.0





  parent reply	other threads:[~2021-12-21 22:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 22:42 [bug#52723] [PATCH] gnu: maven: Update to 3.8.4 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 01/26] gnu: Add apache-parent-pom-23 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 02/26] gnu: Add apache-commons-parent-pom-52 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 03/26] gnu: Add plexus-parent-pom-8 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 04/26] gnu: Add maven-parent-pom-34 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 05/26] gnu: maven-parent-pom: Fix dependency versions Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 06/26] gnu: java-commons-codec: Use latest commons parent Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 07/26] gnu: java-plexus-utils: Default to the newer one Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 08/26] gnu: Add java-plexus-build-api Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 09/26] gnu: java-plexus-cipher: Update to 2.0 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 10/26] gnu: java-plexus-sec-dispatcher: " Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 11/26] gnu: Add java-jvnet-parent-pom-3 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 12/26] gnu: java-jsr250: Use proper source Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 13/26] gnu: java-eclipse-sisu-inject: Update to 0.3.5 Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 14/26] gnu: java-eclipse-sisu-plexus: " Julien Lepiller
2021-12-21 22:44 ` [bug#52723] [PATCH 15/26] gnu: maven-common-artifact-filters: Update to 3.2.0 Julien Lepiller
2021-12-21 22:45 ` Julien Lepiller [this message]
2021-12-21 22:45 ` [bug#52723] [PATCH 17/26] gnu: Add java-sonatype-aether-api-1.13 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 18/26] gnu: Add java-sonatype-aether-spi-1.13 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 19/26] gnu: Add java-sonatype-aether-test-util-1.13 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 20/26] gnu: Add java-sonatype-aether-util-1.13 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 21/26] gnu: maven-dependency-tree: Update to 3.1.0 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 22/26] guix: maven: Fix java parser Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 23/26] gnu: maven-enforcer-api: Update to 3.0.0 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 24/26] gnu: maven-wagon-provider-api: Update to 3.4.3 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 25/26] gnu: Update maven-artifact-transfer to 0.13.1 Julien Lepiller
2021-12-21 22:45 ` [bug#52723] [PATCH 26/26] gnu: maven: Update to 3.8.4 Julien Lepiller
2022-02-02 22:41 ` [bug#52723] [PATCH] " Björn Höfling
2022-02-05 16:16 ` Björn Höfling
2022-02-05 21:53   ` bug#52723: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b41febe67ce9bbb5965a483486b5d748e9871ebc.1640126679.git.julien@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=52723@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).