Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-5561] Plugin relocation loses configuration #642

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public PluginDescriptor loadPlugin( Plugin plugin, List<RemoteRepository> reposi
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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
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;
Expand Down Expand Up @@ -54,12 +55,14 @@ public void execute( MavenSession session, List<MojoExecution> mojoExecutions, P
}


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;
}
Expand Down