本文整理汇总了Java中org.apache.maven.plugin.MojoExecution.getExecutionId方法的典型用法代码示例。如果您正苦于以下问题:Java MojoExecution.getExecutionId方法的具体用法?Java MojoExecution.getExecutionId怎么用?Java MojoExecution.getExecutionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.plugin.MojoExecution
的用法示例。
在下文中一共展示了MojoExecution.getExecutionId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NarTestCompileBuildParticipant
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
public NarTestCompileBuildParticipant(MojoExecution execution, boolean runOnIncremental, boolean runOnConfiguration) {
super(new MojoExecution(execution.getMojoDescriptor(), execution.getExecutionId(), execution.getSource()), runOnIncremental, runOnConfiguration);
// Some versions of nar-maven-plugin don't have a nar-test-unpack goal
// this means the test artifacts won't be available to us.
// What we need to do is run the nar-testCompile goal without any tests
// its configuration in order to just unpack.
Xpp3Dom configuration = new Xpp3Dom(execution.getConfiguration());
logger.debug("Configuration before: " + configuration);
for (int i = 0; i < configuration.getChildCount(); ++i) {
if ("tests".equals(configuration.getChild(i).getName())) {
configuration.removeChild(i);
break;
}
}
logger.debug("Configuration after: " + configuration);
getMojoExecution().setConfiguration(configuration);
}
示例2: releaseMojo
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
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 );
}
}
}
示例3: MojoProfile
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
public MojoProfile(Context c, MojoExecution mojoExecution, ExecutionEvent event) {
super(new Timer(), event, c);
this.mojoExecution = mojoExecution;
this.pluginGroupID = mojoExecution.getGroupId();
this.pluginArtifactID = mojoExecution.getArtifactId();
this.pluginVersion = mojoExecution.getVersion();
this.pluginExecutionId = mojoExecution.getExecutionId();
this.event = event;
// get the configuration of the plugin if the group id matches the KEY.
// please replace the KEY
String configuration = "";
if (mojoExecution.getPlugin().getConfiguration() != null
&& mojoExecution.getPlugin().getGroupId().contains("KEY")) {
configuration = mojoExecution.getPlugin().getConfiguration().toString();
}
String payload = " (" + pluginExecutionId + ") " + configuration;
if (getSession() != null) {
plugin.setGroupId(pluginGroupID);
plugin.setArtifactId(pluginArtifactID);
plugin.setVersion(pluginVersion);
plugin.setPluginKey(mojoExecution.getPlugin().getId());
plugin.setStartTime(new Date(this.getTimer().getStartTime()));
plugin.setPayload(payload);
plugin.setExecutionId(pluginExecutionId);
if (getSession().getCurrentProject().getPhases().size() > 0) {
getSession().getCurrentProject().getLastPhase().getPlugins().add(plugin);
}
}
}
示例4: append
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
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( ')' );
}
}
示例5: debugMojoExecution
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
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() );
}
示例6: getIdForProfile
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
private String getIdForProfile(MojoExecution pluginExecution) {
String executionId = pluginExecution.getExecutionId();
if (executionId != null && usedExecutionIds.add(executionId)) {
return executionId;
}
String id;
do {
id = "maven-" + executionIdGenerator++;
} while (!usedExecutionIds.add(id));
return id;
}
示例7: createMojoKey
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
private MojoKey createMojoKey( MojoExecution mojo )
{
return new MojoKey( mojo.getGroupId(), mojo.getArtifactId(), mojo.getVersion(), mojo.getGoal(),
mojo.getExecutionId(), mojo.getLifecyclePhase() );
}
示例8: _handle
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
@Override
public boolean _handle(@Nonnull ExecutionEvent executionEvent) {
List<String> configurationParameters = getConfigurationParametersToReport(executionEvent);
Xpp3Dom root = new Xpp3Dom("ExecutionEvent");
root.setAttribute("class", executionEvent.getClass().getName());
root.setAttribute("type", executionEvent.getType().name());
root.addChild(newElement("project", executionEvent.getProject()));
MojoExecution execution = executionEvent.getMojoExecution();
if (execution == null) {
root.addChild(new Xpp3Dom("no-execution-found"));
} else {
Xpp3Dom plugin = new Xpp3Dom("plugin");
root.addChild(plugin);
plugin.setAttribute("groupId", execution.getGroupId());
plugin.setAttribute("artifactId", execution.getArtifactId());
plugin.setAttribute("goal", execution.getGoal());
plugin.setAttribute("version", execution.getVersion());
if (execution.getExecutionId() != null) {
// See JENKINS-47508, caused by plugin being declared and invoked by the <reports> section
plugin.setAttribute("executionId", execution.getExecutionId());
}
if (execution.getLifecyclePhase() != null) {
// protect against null lifecyclePhase. cause is NOT clear
plugin.setAttribute("lifecyclePhase", execution.getLifecyclePhase());
}
for (String configurationParameter : configurationParameters) {
Xpp3Dom element = fullClone(configurationParameter, execution.getConfiguration().getChild(configurationParameter));
if (element != null) {
plugin.addChild(element);
}
}
}
addDetails(executionEvent, root);
reporter.print(root);
return true;
}
示例9: getFileSystemServerKey
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
protected static String getFileSystemServerKey( MojoExecution mojoExecution )
{
return FileSystemServer.class.getName() + "@" + mojoExecution.getExecutionId();
}
示例10: ExecutionKey
import org.apache.maven.plugin.MojoExecution; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param mojoExecution The mojo execution as provided by Maven.
*/
private ExecutionKey(MojoExecution mojoExecution) {
this.goal = mojoExecution.getGoal();
this.execution = mojoExecution.getExecutionId();
}