本文整理匯總了Java中org.apache.maven.plugin.MojoExecution.getArtifactId方法的典型用法代碼示例。如果您正苦於以下問題:Java MojoExecution.getArtifactId方法的具體用法?Java MojoExecution.getArtifactId怎麽用?Java MojoExecution.getArtifactId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.plugin.MojoExecution
的用法示例。
在下文中一共展示了MojoExecution.getArtifactId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getBuildParticipant
import org.apache.maven.plugin.MojoExecution; //導入方法依賴的package包/類
@Override
public AbstractBuildParticipant getBuildParticipant(
IMavenProjectFacade projectFacade, MojoExecution execution,
IPluginExecutionMetadata executionMetadata) {
String artifactId = execution.getArtifactId();
if (log.isDebugEnabled()) {
log.debug("getBuildParticipant: artifactId={}", artifactId);
}
String inputPathParam;
String outputPathParam;
if ("libsass-maven-plugin".equals(artifactId)) {
inputPathParam = "inputPath";
outputPathParam = "outputPath";
} else if ("sass-maven-plugin".equals(artifactId)) {
inputPathParam = "sassSourceDirectory";
outputPathParam = "destination";
} else {
throw new IllegalStateException("Unsupported artifactId <"
+ artifactId + ">");
}
return new BuildParticipant(execution, inputPathParam, outputPathParam);
}
示例2: 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);
}
}
}
示例3: 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() );
}
示例4: getBuildParticipant
import org.apache.maven.plugin.MojoExecution; //導入方法依賴的package包/類
@Override
public AbstractBuildParticipant getBuildParticipant(IMavenProjectFacade projectFacade, MojoExecution execution,
IPluginExecutionMetadata executionMetadata) {
String artifactId = execution.getArtifactId();
if (log.isDebugEnabled()) {
log.debug("getBuildParticipant: artifactId={}", artifactId);
}
return new GenericBuildParticipant(execution, "sourceDirectory", "outputDirectory");
}
示例5: 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() );
}