本文整理了Java中org.apache.maven.plugin.MojoExecution.getGroupId()
方法的一些代码示例,展示了MojoExecution.getGroupId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MojoExecution.getGroupId()
方法的具体详情如下:
包路径:org.apache.maven.plugin.MojoExecution
类名称:MojoExecution
方法名:getGroupId
暂无
代码示例来源:origin: apache/maven
private void debugMojoExecution( MojoExecution mojoExecution )
{
String mojoExecId =
mojoExecution.getGroupId() + ':' + mojoExecution.getArtifactId() + ':' + mojoExecution.getVersion() + ':'
+ mojoExecution.getGoal() + " (" + mojoExecution.getExecutionId() + ')';
Map<String, List<MojoExecution>> forkedExecutions = mojoExecution.getForkedExecutions();
if ( !forkedExecutions.isEmpty() )
{
for ( Map.Entry<String, List<MojoExecution>> fork : forkedExecutions.entrySet() )
{
logger.debug( "--- init fork of " + fork.getKey() + " for " + mojoExecId + " ---" );
debugDependencyRequirements( fork.getValue() );
for ( MojoExecution forkedExecution : fork.getValue() )
{
debugMojoExecution( forkedExecution );
}
logger.debug( "--- exit fork of " + fork.getKey() + " for " + mojoExecId + " ---" );
}
}
logger.debug( "-----------------------------------------------------------------------" );
logger.debug( "Goal: " + mojoExecId );
logger.debug(
"Style: " + ( mojoExecution.getMojoDescriptor().isAggregator() ? "Aggregating" : "Regular" ) );
logger.debug( "Configuration: " + mojoExecution.getConfiguration() );
}
代码示例来源:origin: apache/maven
private static String createMessage( MojoExecution execution, MavenProject project, Throwable cause )
{
MessageBuilder buffer = buffer( 256 );
buffer.a( "Failed to execute goal" );
if ( execution != null )
{
buffer.a( ' ' );
buffer.mojo( execution.getGroupId() + ':' + execution.getArtifactId() + ':' + execution.getVersion() + ':'
+ execution.getGoal() );
buffer.a( ' ' ).strong( '(' + execution.getExecutionId() + ')' );
}
if ( project != null )
{
buffer.a( " on project " );
buffer.project( project.getArtifactId() );
}
if ( cause != null )
{
buffer.a( ": " ).failure( cause.getMessage() );
}
return buffer.toString();
}
代码示例来源:origin: apache/maven
@Override
public void configure( MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig )
{
String g = mojoExecution.getGroupId();
String a = mojoExecution.getArtifactId();
Plugin plugin = findPlugin( g, a, project.getBuildPlugins() );
if ( plugin == null && project.getPluginManagement() != null )
{
plugin = findPlugin( g, a, project.getPluginManagement().getPlugins() );
}
if ( plugin != null )
{
PluginExecution pluginExecution =
findPluginExecution( mojoExecution.getExecutionId(), plugin.getExecutions() );
Xpp3Dom pomConfiguration = null;
if ( pluginExecution != null )
{
pomConfiguration = (Xpp3Dom) pluginExecution.getConfiguration();
}
else if ( allowPluginLevelConfig )
{
pomConfiguration = (Xpp3Dom) plugin.getConfiguration();
}
Xpp3Dom mojoConfiguration = ( pomConfiguration != null ) ? new Xpp3Dom( pomConfiguration ) : null;
mojoConfiguration = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoConfiguration );
mojoExecution.setConfiguration( mojoConfiguration );
}
}
代码示例来源:origin: m2e-code-quality/m2e-code-quality
public static boolean mojoExecutionForPlugin(
final MojoExecution mojoExecution, final String groupId,
final String artifactId, final String goal) {
return groupId.equals(mojoExecution.getGroupId())
&& artifactId.equals(mojoExecution.getArtifactId())
&& (goal == null || goal.equals(mojoExecution.getGoal()));
}
代码示例来源:origin: m2e-code-quality/m2e-code-quality
protected MojoExecution findForkedExecution(final MojoExecution primary,
final String groupId, final String artifactId, final String goal) {
final Map<String, List<MojoExecution>> forkedExecutions =
primary.getForkedExecutions();
MojoExecution goalExecution = null;
for (final List<MojoExecution> possibleExecutionList : forkedExecutions
.values()) {
for (final MojoExecution possibleExecution : possibleExecutionList) {
if (groupId.equals(possibleExecution.getGroupId())
&& artifactId.equals(possibleExecution.getArtifactId())
&& goal.equals(possibleExecution.getGoal())) {
goalExecution = possibleExecution;
break;
}
}
if (goalExecution != null) {
break;
}
}
return goalExecution;
}
代码示例来源:origin: jenkinsci/maven-plugin
private String mojoExec(ExecutionEvent event) {
MojoExecution me = event.getMojoExecution();
return String.format("%s:%s:%s(%s)", me.getGroupId(), me.getArtifactId(), me.getVersion(), me.getExecutionId());
}
}
代码示例来源:origin: takari/maven-profiler
public String getId() {
return mojoExecution.getGroupId() + ":" + mojoExecution.getArtifactId() + ":" + mojoExecution.getVersion() + " (" + mojoExecution.getExecutionId() + ") ";
}
代码示例来源:origin: jenkinsci/pipeline-maven-plugin
public boolean handle(@Nonnull Object event) {
if (!(event instanceof ExecutionEvent)) {
return false;
}
ExecutionEvent executionEvent = (ExecutionEvent) event;
ExecutionEvent.Type supportedType = getSupportedType();
if (supportedType != null && !(supportedType.equals(executionEvent.getType()))) {
return false;
}
String supportedGoal = getSupportedPluginGoal();
if (supportedGoal == null) {
return _handle(executionEvent);
} else {
String[] gag = supportedGoal.split(":");
if (gag.length == 3) {
MojoExecution execution = executionEvent.getMojoExecution();
if (execution.getGroupId().equals(gag[0]) && execution.getArtifactId().equals(gag[1]) && execution.getGoal().equals(gag[2])) {
_handle(executionEvent);
return true;
} else {
return false;
}
} else {
reporter.print(toString() + " - unsupported supportedPluginGoal:" + supportedGoal);
return false;
}
}
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* @see org.apache.maven.execution.ExecutionListener#forkFailed(org.apache.maven.execution.ExecutionEvent)
*/
public void forkFailed( ExecutionEvent event ) {
maven3Builder.listener.getLogger().println("mojo forkFailed " + event.getMojoExecution().getGroupId() + ":"
+ event.getMojoExecution().getArtifactId() + ":"
+ event.getMojoExecution().getVersion()
+ "(" + event.getMojoExecution().getExecutionId() + ")");
reccordMojoFailed( event );
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* @see org.apache.maven.execution.ExecutionListener#mojoSkipped(org.apache.maven.execution.ExecutionEvent)
*/
public void mojoSkipped( ExecutionEvent event ) {
maven3Builder.listener.getLogger().println("mojoSkipped " + event.getMojoExecution().getGroupId() + ":"
+ event.getMojoExecution().getArtifactId() + ":"
+ event.getMojoExecution().getVersion()
+ "(" + event.getMojoExecution().getExecutionId() + ")");
this.eventLogger.mojoSkipped( event );
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* @see org.apache.maven.execution.ExecutionListener#forkStarted(org.apache.maven.execution.ExecutionEvent)
*/
public void forkStarted( ExecutionEvent event )
{
maven3Builder.listener.getLogger().println("mojo forkStarted " + event.getMojoExecution().getGroupId() + ":"
+ event.getMojoExecution().getArtifactId() + ":"
+ event.getMojoExecution().getVersion()
+ "(" + event.getMojoExecution().getExecutionId() + ")");
reccordMojoStarted( event );
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* @see org.apache.maven.execution.ExecutionListener#forkSucceeded(org.apache.maven.execution.ExecutionEvent)
*/
public void forkSucceeded( ExecutionEvent event ) {
maven3Builder.listener.getLogger().println("mojo forkSucceeded " + event.getMojoExecution().getGroupId() + ":"
+ event.getMojoExecution().getArtifactId() + ":"
+ event.getMojoExecution().getVersion()
+ "(" + event.getMojoExecution().getExecutionId() + ")");
reccordMojoSucceeded( event );
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
/**
* @see org.apache.maven.execution.ExecutionListener#mojoFailed(org.apache.maven.execution.ExecutionEvent)
*/
public void mojoFailed( ExecutionEvent event ) {
maven3Builder.listener.getLogger().println("mojoFailed " + event.getMojoExecution().getGroupId() + ":"
+ event.getMojoExecution().getArtifactId() + ":"
+ event.getMojoExecution().getVersion()
+ "(" + event.getMojoExecution().getExecutionId() + ")");
reccordMojoFailed( event );
this.eventLogger.mojoFailed( event );
}
代码示例来源:origin: jenkinsci/pipeline-maven-plugin
root.addChild(plugin);
plugin.setAttribute("groupId", execution.getGroupId());
plugin.setAttribute("artifactId", execution.getArtifactId());
plugin.setAttribute("goal", execution.getGoal());
代码示例来源:origin: io.takari.maven.plugins/takari-lifecycle-plugin
@Override
public void configure(MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig) {
String groupId = mojoExecution.getGroupId();
String artifactId = mojoExecution.getArtifactId();
Plugin plugin = findPlugin(groupId, artifactId, project.getBuildPlugins());
代码示例来源:origin: takari/takari-lifecycle
@Override
public void configure(MavenProject project, MojoExecution mojoExecution, boolean allowPluginLevelConfig) {
String groupId = mojoExecution.getGroupId();
String artifactId = mojoExecution.getArtifactId();
Plugin plugin = findPlugin(groupId, artifactId, project.getBuildPlugins());
内容来源于网络,如有侵权,请联系作者删除!