You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/12/25 11:29:02 UTC
[maven] branch relocation-fixes created (now 1f18da2)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch relocation-fixes
in repository https://gitbox.apache.org/repos/asf/maven.git.
at 1f18da2 Use original GA
This branch includes the following new commits:
new 6636021 Retain type
new 1f18da2 Use original GA
The 2 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] 02/02: Use original GA
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch relocation-fixes
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 1f18da205857e02d86a575a6f4999718a7980114
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 25 12:28:47 2021 +0100
Use original GA
---
.../lifecycle/internal/DefaultMojoExecutionConfigurator.java | 4 ++--
.../maven/lifecycle/internal/stub/BuildPluginManagerStub.java | 2 +-
.../apache/maven/lifecycle/internal/stub/MojoExecutorStub.java | 9 ++++++---
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
index 176ba32..8c809de 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
@@ -41,9 +41,9 @@ public class DefaultMojoExecutionConfigurator
@Override
public void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig )
{
- String g = mojoExecution.getGroupId();
+ String g = mojoExecution.getPlugin().getGroupId();
- String a = mojoExecution.getArtifactId();
+ String a = mojoExecution.getPlugin().getArtifactId();
Plugin plugin = findPlugin( g, a, project.getBuildPlugins() );
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
index 133bcb3..cdb00fc 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/BuildPluginManagerStub.java
@@ -42,7 +42,7 @@ public class BuildPluginManagerStub
public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, List<RemoteRepository> repositories,
RepositorySystemSession session )
{
- return MojoExecutorStub.createMojoDescriptor( plugin.getKey() );
+ return MojoExecutorStub.createMojoDescriptor( plugin );
}
public ClassRealm getPluginRealm( MavenSession session, PluginDescriptor pluginDescriptor )
diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
index 8a6580b..763893e 100644
--- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
+++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/MojoExecutorStub.java
@@ -21,6 +21,7 @@ import org.apache.maven.lifecycle.internal.DependencyContext;
import org.apache.maven.lifecycle.internal.MojoExecutor;
import org.apache.maven.lifecycle.internal.PhaseRecorder;
import org.apache.maven.lifecycle.internal.ProjectIndex;
+import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
@@ -54,12 +55,14 @@ public class MojoExecutorStub
}
- public static MojoDescriptor createMojoDescriptor( String mojoDescription )
+ public static MojoDescriptor createMojoDescriptor( Plugin plugin )
{
final PluginDescriptor descriptor = new PluginDescriptor();
- descriptor.setArtifactId( mojoDescription );
+ descriptor.setGroupId( plugin.getGroupId() );
+ descriptor.setArtifactId( plugin.getArtifactId() );
+ descriptor.setPlugin( plugin );
+ descriptor.setVersion( plugin.getVersion() );
final MojoDescriptor mojoDescriptor = new MojoDescriptor();
- mojoDescriptor.setDescription( mojoDescription );
mojoDescriptor.setPluginDescriptor( descriptor );
return mojoDescriptor;
}
[maven] 01/02: Retain type
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch relocation-fixes
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 6636021945bd4f04e0b0c0b68cecc2495c5238c3
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Dec 25 12:28:18 2021 +0100
Retain type
---
.../repository/internal/RelocatedArtifact.java | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
index 2e277f0..85fa604 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java
@@ -86,6 +86,39 @@ final class RelocatedArtifact
}
}
+ @Override
+ public Artifact setVersion( String version )
+ {
+ String current = getVersion();
+ if ( current.equals( version ) || ( version == null && current.length() <= 0 ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact, groupId, artifactId, version );
+ }
+
+ @Override
+ public Artifact setFile( File file )
+ {
+ File current = getFile();
+ if ( Objects.equals( current, file ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact.setFile( file ), groupId, artifactId, version );
+ }
+
+ @Override
+ public Artifact setProperties( Map<String, String> properties )
+ {
+ Map<String, String> current = getProperties();
+ if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) )
+ {
+ return this;
+ }
+ return new RelocatedArtifact( artifact.setProperties( properties ), groupId, artifactId, version );
+ }
+
public String getClassifier()
{
return artifact.getClassifier();