本文整理匯總了Java中org.apache.maven.plugin.MojoExecution.setConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:Java MojoExecution.setConfiguration方法的具體用法?Java MojoExecution.setConfiguration怎麽用?Java MojoExecution.setConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.plugin.MojoExecution
的用法示例。
在下文中一共展示了MojoExecution.setConfiguration方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureMojo
import org.apache.maven.plugin.MojoExecution; //導入方法依賴的package包/類
private Mojo configureMojo(final String parameter, final String value) throws Exception {
final MavenSession mavenSession = mojoRule.newMavenSession(getMavenProject(DEFAULT_CONFIG));
final MojoExecution mojoExecution = mojoRule.newMojoExecution(GOAL_NAME);
final Xpp3Dom configuration = new Xpp3Dom("configuration");
final Xpp3Dom generationConfig = new Xpp3Dom("generationConfig");
final Xpp3Dom useBigDecimal = new Xpp3Dom(parameter);
useBigDecimal.setValue(value);
generationConfig.addChild(useBigDecimal);
configuration.addChild(generationConfig);
mojoExecution.setConfiguration(configuration);
return mojoRule.lookupConfiguredMojo(mavenSession, mojoExecution);
}
示例2: compile
import org.apache.maven.plugin.MojoExecution; //導入方法依賴的package包/類
private void compile(File basedir, File processor, String executionId) throws Exception {
MavenProject project = mojos.readMavenProject(basedir);
MavenSession session = mojos.newMavenSession(project);
MojoExecution execution = mojos.newMojoExecution();
MojoExecution cloned = new MojoExecution(execution.getMojoDescriptor(), executionId, null);
cloned.setConfiguration(execution.getConfiguration());
execution.getConfiguration().addChild(newParameter("proc", Proc.none.name()));
addDependency(project, "processor", new File(processor, "target/classes"));
mojos.executeMojo(session, project, cloned);
}
示例3: createMojoExecution
import org.apache.maven.plugin.MojoExecution; //導入方法依賴的package包/類
private static MojoExecution createMojoExecution( String goal, String executionId, MojoDescriptor mojoDescriptor )
{
final Plugin plugin = mojoDescriptor.getPluginDescriptor().getPlugin();
MojoExecution result = new MojoExecution( plugin, goal, executionId );
result.setConfiguration( new Xpp3Dom( executionId + "-" + goal ) );
result.setMojoDescriptor( mojoDescriptor );
result.setLifecyclePhase( mojoDescriptor.getPhase() );
return result;
}