本文整理了Java中org.apache.maven.plugin.MojoExecution.getExecutionId()
方法的一些代码示例,展示了MojoExecution.getExecutionId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MojoExecution.getExecutionId()
方法的具体详情如下:
包路径:org.apache.maven.plugin.MojoExecution
类名称:MojoExecution
方法名:getExecutionId
暂无
代码示例来源:origin: apache/maven
public void releaseMojo( Object mojo, MojoExecution mojoExecution )
{
if ( mojo != null )
{
try
{
container.release( mojo );
}
catch ( ComponentLifecycleException e )
{
String goalExecId = mojoExecution.getGoal();
if ( mojoExecution.getExecutionId() != null )
{
goalExecId += " {execution: " + mojoExecution.getExecutionId() + "}";
}
logger.debug( "Error releasing mojo for " + goalExecId, e );
}
}
}
代码示例来源:origin: apache/maven
private static String constructMessage( MojoExecution mojoExecution, Throwable cause )
{
String message;
if ( mojoExecution != null )
{
message =
"Execution " + mojoExecution.getExecutionId() + " of goal " + mojoExecution.getMojoDescriptor().getId()
+ " failed";
}
else
{
message = "Mojo execution failed";
}
if ( cause != null && StringUtils.isNotEmpty( cause.getMessage() ) )
{
message += ": " + cause.getMessage();
}
else
{
message += ".";
}
return message;
}
代码示例来源:origin: apache/maven
private void append( MessageBuilder buffer, MojoExecution me )
{
buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() );
if ( me.getExecutionId() != null )
{
buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' );
}
}
代码示例来源: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
new MojoExecution( forkedMojoDescriptor, mojoExecution.getExecutionId() );
代码示例来源: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: reactiverse/vertx-maven-plugin
private void addExecutionIfNotContainedAlready(MojoExecution execution) {
String artifact = execution.getArtifactId();
String id = execution.getExecutionId();
// We must avoid duplicates in the list
for (MojoExecution exec : MOJOS) {
if (exec.getArtifactId().equals(artifact) && exec.getExecutionId().equals(id)) {
// Duplicate found.
return;
}
}
MOJOS.add(execution);
}
代码示例来源:origin: org.jvnet.hudson.main/maven-plugin
private void append( StringBuilder buffer, MojoExecution me )
{
buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() );
buffer.append( ':' ).append( me.getGoal() );
if ( me.getExecutionId() != null )
{
buffer.append( " (" ).append( me.getExecutionId() ).append( ')' );
}
}
代码示例来源:origin: io.tesla.maven/maven-embedder
private void append( StringBuilder buffer, MojoExecution me )
{
buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() );
buffer.append( ':' ).append( me.getGoal() );
if ( me.getExecutionId() != null )
{
buffer.append( " (" ).append( me.getExecutionId() ).append( ')' );
}
}
代码示例来源:origin: timgifford/maven-buildtime-extension
public MojoExecutionName(MojoExecution mojoExecution) {
name = String.format(Locale.ENGLISH,
"%s:%s (%s)",
mojoExecution.getArtifactId(),
mojoExecution.getGoal(),
mojoExecution.getExecutionId());
}
代码示例来源:origin: io.takari/incrementalbuild
/**
* Returns conventional MojoExecution identifier used by incremental build tools.
*/
public String getExecutionId(MojoExecution execution) {
PluginDescriptor pluginDescriptor = execution.getMojoDescriptor().getPluginDescriptor();
StringBuilder builderId = new StringBuilder();
builderId.append(pluginDescriptor.getGroupId()).append('_')
.append(pluginDescriptor.getArtifactId());
builderId.append('_').append(execution.getGoal()).append('_')
.append(execution.getExecutionId());
return builderId.toString();
}
代码示例来源:origin: mojohaus/jaxb2-maven-plugin
/**
* Acquires the staleFile for this execution
*
* @return the staleFile (used to define where) for this execution
*/
protected final File getStaleFile() {
final String staleFileName = "."
+ (getExecution() == null ? "nonExecutionJaxb" : getExecution().getExecutionId())
+ "-" + getStaleFileName();
return new File(staleFileDirectory, staleFileName);
}
代码示例来源:origin: org.apache.maven/maven-embedder
private void append( MessageBuilder buffer, MojoExecution me )
{
buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() );
if ( me.getExecutionId() != null )
{
buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' );
}
}
代码示例来源: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#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#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: org.hudsonci.plugins/maven3-eventspy-3.1
private void recordMojoStarted( final ExecutionEvent event )
{
if( ExecutionEvent.Type.MojoStarted.equals(event.getType()) )
{
MojoExecution mojoExecution = event.getMojoExecution();
ProjectLogger.log(event.getProject(), "mojo started - " + mojoExecution.getLifecyclePhase() + " " + mojoExecution.getArtifactId() + " " + mojoExecution.getExecutionId() );
// There are none.
//log.debug("Mojo Plugin deps: {}", mojoExecution.getPlugin().getDependencies());
}
}
内容来源于网络,如有侵权,请联系作者删除!