You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2022/07/10 16:39:47 UTC

[maven-reporting-exec] branch update-module created (now 3cd18de)

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a change to branch update-module
in repository https://gitbox.apache.org/repos/asf/maven-reporting-exec.git


      at 3cd18de  Update module:

This branch includes the following new commits:

     new 3cd18de  Update module:

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-reporting-exec] 01/01: Update module:

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch update-module
in repository https://gitbox.apache.org/repos/asf/maven-reporting-exec.git

commit 3cd18de105f1a12285ff89b5364ae584927cc02e
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Sun Jul 10 18:39:23 2022 +0200

    Update module:
    
    * drop m-shared-utils (was used only for StringUtils!!!)
    * drop plexus container default and plexus annotations, migrate to JSR330
    * set plexus-classworld scope proper, IS USED in main
---
 pom.xml                                            | 39 ++++++++++------------
 .../exec/DefaultMavenPluginManagerHelper.java      | 20 ++++++++---
 .../reporting/exec/DefaultMavenReportExecutor.java | 37 +++++++++++++-------
 3 files changed, 57 insertions(+), 39 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9a989e8..3c4a43e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,46 +77,42 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-model</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-settings</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-settings-builder</artifactId>
       <version>${mavenVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>maven-shared-utils</artifactId>
-      <version>3.3.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-annotations</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.1.0</version><!-- do not upgrade to 3.2.0+ because it adds Xpp3Dom.getInputLocation(): see MSHARED-921 -->
+      <version>3.4.2</version>
     </dependency>
 
     <dependency>
@@ -130,18 +126,24 @@
       <artifactId>slf4j-api</artifactId>
       <version>${slf4jVersion}</version>
     </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+    </dependency>
 
     <!-- Eclipse Aether for Maven 3.1+ -->
     <dependency>
       <groupId>org.eclipse.aether</groupId>
       <artifactId>aether-api</artifactId>
       <version>${aetherVersion}</version>
-      <optional>true</optional>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.eclipse.aether</groupId>
       <artifactId>aether-util</artifactId>
       <version>${aetherVersion}</version>
+      <scope>compile</scope>
     </dependency>
 
     <!-- test -->
@@ -188,11 +190,11 @@
       <scope>test</scope>
     </dependency>
 
-    <!-- Used actually in tests only, but if in test scope the transitive dep will be gone -->
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-classworlds</artifactId>
-      <version>2.5.2</version>
+      <version>2.6.0</version>
+      <scope>compile</scope>
     </dependency>
 
     <dependency>
@@ -272,15 +274,8 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>generate-metadata</goal>
-            </goals>
-          </execution>
-        </executions>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
index e24ae3b..8c68b00 100644
--- a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
+++ b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenPluginManagerHelper.java
@@ -19,6 +19,10 @@ package org.apache.maven.reporting.exec;
  * under the License.
  */
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import java.util.List;
 
 import org.apache.maven.execution.MavenSession;
@@ -29,22 +33,28 @@ import org.apache.maven.plugin.PluginContainerException;
 import org.apache.maven.plugin.PluginDescriptorParsingException;
 import org.apache.maven.plugin.PluginResolutionException;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.graph.DependencyFilter;
 import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.util.filter.ExclusionsDependencyFilter;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * <p>DefaultMavenPluginManagerHelper class.</p>
  */
-@Component( role = MavenPluginManagerHelper.class )
+@Singleton
+@Named
 public class DefaultMavenPluginManagerHelper
     implements MavenPluginManagerHelper
 {
-    @Requirement
-    protected MavenPluginManager mavenPluginManager;
+    private final MavenPluginManager mavenPluginManager;
+
+    @Inject
+    public DefaultMavenPluginManagerHelper( MavenPluginManager mavenPluginManager )
+    {
+        this.mavenPluginManager = requireNonNull( mavenPluginManager );
+    }
 
     private DependencyFilter createExclusionsDependencyFilter( List<String> artifactIdsList )
     {
diff --git a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
index 3f57bc1..faa1abc 100644
--- a/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
+++ b/src/main/java/org/apache/maven/reporting/exec/DefaultMavenReportExecutor.java
@@ -19,6 +19,10 @@ package org.apache.maven.reporting.exec;
  * under the License.
  */
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -46,15 +50,15 @@ import org.apache.maven.plugin.version.PluginVersionResolver;
 import org.apache.maven.plugin.version.PluginVersionResult;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.reporting.MavenReport;
-import org.apache.maven.shared.utils.StringUtils;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 import org.codehaus.plexus.util.xml.Xpp3DomUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static java.util.Objects.requireNonNull;
+
 /**
  * <p>
  * This component will build some {@link MavenReportExecution} from {@link MavenReportExecutorRequest}. If a
@@ -95,23 +99,20 @@ import org.slf4j.LoggerFactory;
  *
  * @author Olivier Lamy
  */
-@Component( role = MavenReportExecutor.class )
+@Singleton
+@Named
 public class DefaultMavenReportExecutor
     implements MavenReportExecutor
 {
     private static final Logger LOGGER = LoggerFactory.getLogger( DefaultMavenReportExecutor.class );
 
-    @Requirement
-    protected MavenPluginManager mavenPluginManager;
+    private final MavenPluginManager mavenPluginManager;
 
-    @Requirement
-    protected MavenPluginManagerHelper mavenPluginManagerHelper;
+    private final MavenPluginManagerHelper mavenPluginManagerHelper;
 
-    @Requirement
-    protected LifecycleExecutor lifecycleExecutor;
+    private final LifecycleExecutor lifecycleExecutor;
 
-    @Requirement
-    protected PluginVersionResolver pluginVersionResolver;
+    private final PluginVersionResolver pluginVersionResolver;
 
     private static final List<String> IMPORTS = Arrays.asList( "org.apache.maven.reporting.MavenReport",
                                                                "org.apache.maven.reporting.MavenMultiPageReport",
@@ -129,6 +130,18 @@ public class DefaultMavenReportExecutor
     private static final List<String> EXCLUDES = Arrays.asList( "doxia-site-renderer", "doxia-sink-api",
                                                                 "maven-reporting-api" );
 
+    @Inject
+    public DefaultMavenReportExecutor( MavenPluginManager mavenPluginManager,
+                                       MavenPluginManagerHelper mavenPluginManagerHelper,
+                                       LifecycleExecutor lifecycleExecutor,
+                                       PluginVersionResolver pluginVersionResolver )
+    {
+        this.mavenPluginManager = requireNonNull( mavenPluginManager );
+        this.mavenPluginManagerHelper = requireNonNull( mavenPluginManagerHelper );
+        this.lifecycleExecutor = requireNonNull( lifecycleExecutor );
+        this.pluginVersionResolver = requireNonNull( pluginVersionResolver );
+    }
+
     @Override
     public List<MavenReportExecution> buildMavenReports( MavenReportExecutorRequest mavenReportExecutorRequest )
         throws MojoExecutionException