You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2022/07/03 15:57:36 UTC

[maven] branch MNG-7353 updated (e517a8ccc -> 6d1a59d99)

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

hboutemy pushed a change to branch MNG-7353
in repository https://gitbox.apache.org/repos/asf/maven.git


    omit e517a8ccc [MNG-7353] support CLI "mvn pluginPrefix:version:goal"
     add b3e7e57e4 [MNG-7504] Don't print warning unsupported reportPlugins for m-site-p
     add e4f347ed8 [MNG-6965] Extensions suddenly have org.codehaus.plexus:plexus-utils:jar:1.1 on their classpath
     add c9a3e0e45 [MNG-7501] add relative path to pom.xml in module build start output
     add 9b876fa90 [MNG-7506] Upgrade Maven Wagon to 3.5.2
     new 6d1a59d99 [MNG-7353] support CLI "mvn pluginPrefix:version:goal"

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e517a8ccc)
            \
             N -- N -- N   refs/heads/MNG-7353 (6d1a59d99)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 .../internal/DefaultMojoExecutionConfigurator.java | 49 +++++++-----
 .../lifecycle/internal/MojoDescriptorCreator.java  |  2 +-
 .../DefaultPluginDependenciesResolver.java         | 12 +--
 .../maven/plugin/internal/PlexusUtilsInjector.java | 87 ----------------------
 .../project/DefaultProjectBuildingHelper.java      |  5 +-
 .../maven/cli/event/ExecutionEventLogger.java      | 10 +++
 .../maven/cli/event/ExecutionEventLoggerTest.java  | 57 ++++++++++++++
 pom.xml                                            |  2 +-
 8 files changed, 103 insertions(+), 121 deletions(-)
 delete mode 100644 maven-core/src/main/java/org/apache/maven/plugin/internal/PlexusUtilsInjector.java


[maven] 01/01: [MNG-7353] support CLI "mvn pluginPrefix:version:goal"

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

hboutemy pushed a commit to branch MNG-7353
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 6d1a59d994230235dcbac640ab5854aec2897ed4
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat Jun 18 23:41:13 2022 +0200

    [MNG-7353] support CLI "mvn pluginPrefix:version:goal"
---
 .../DefaultLifecycleTaskSegmentCalculator.java     |  2 +-
 .../lifecycle/internal/MojoDescriptorCreator.java  | 37 +++++++++++++++-------
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
index cb49050c7..57dd0cc89 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleTaskSegmentCalculator.java
@@ -96,7 +96,7 @@ public class DefaultLifecycleTaskSegmentCalculator
         {
             if ( isGoalSpecification( task ) )
             {
-                // "pluginPrefix:goal" or "groupId:artifactId[:version]:goal"
+                // "pluginPrefix[:version]:goal" or "groupId:artifactId[:version]:goal"
 
                 lifecyclePluginResolver.resolveMissingPluginVersions( session.getTopLevelProject(), session );
 
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
index edb8dceda..320c32960 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoDescriptorCreator.java
@@ -176,18 +176,31 @@ public class MojoDescriptorCreator
         }
         else if ( numTokens == 3 )
         {
-            // We have everything that we need except the version
-            //
-            // org.apache.maven.plugins:maven-remote-resources-plugin:???:process
-            //
-            // groupId
-            // artifactId
-            // ???
-            // goal
-            //
-            plugin = new Plugin();
-            plugin.setGroupId( tok.nextToken() );
-            plugin.setArtifactId( tok.nextToken() );
+            // groupId:artifactId:goal or pluginPrefix:version:goal (since Maven 3.9)
+
+            String firstToken = tok.nextToken();
+            // groupId or pluginPrefix? heuristics: groupId contains . but not pluginPrefix
+            if ( firstToken.contains( "." ) )
+            {
+                // We have everything that we need except the version
+                //
+                // org.apache.maven.plugins:maven-remote-resources-plugin:???:process
+                //
+                // groupId
+                // artifactId
+                // ???
+                // goal
+                //
+                plugin = new Plugin();
+                plugin.setGroupId( firstToken );
+                plugin.setArtifactId( tok.nextToken() );
+            }
+            else
+            {
+                // pluginPrefix:version:goal, like remote-resources:3.5.0:process
+                plugin = findPluginForPrefix( firstToken, session );
+                plugin.setVersion( tok.nextToken() );
+            }
             goal = tok.nextToken();
         }
         else if ( numTokens <= 2 )