本文整理汇总了Java中org.apache.maven.model.PluginExecution.setPriority方法的典型用法代码示例。如果您正苦于以下问题:Java PluginExecution.setPriority方法的具体用法?Java PluginExecution.setPriority怎么用?Java PluginExecution.setPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.PluginExecution
的用法示例。
在下文中一共展示了PluginExecution.setPriority方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMerge_pluginFoundWithNoExecutions
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
@Test
public void testMerge_pluginFoundWithNoExecutions() {
Plugin buildPlugin = new Plugin();
buildPlugin.setArtifactId("merge-artifact");
List<Plugin> plugins = project.getBuild().getPlugins();
plugins.addAll(dummyPlugins);
plugins.add(buildPlugin);
PluginExecution exec = new PluginExecution();
exec.setId("merge-execution-id");
exec.setGoals(Arrays.asList("some-goal"));
exec.setPhase("random-phase");
exec.setPriority(1);
Plugin mergePlugin = new Plugin();
mergePlugin.setArtifactId("merge-artifact");
mergePlugin.getExecutions().add(exec);
item.merge(project, mergePlugin);
Assert.assertEquals("Plugins.Size", dummyPlugins.size() + 1, project.getBuildPlugins().size());
for (int i = 0; i < dummyPlugins.size(); i++) {
Assert.assertThat("Plugins["+i+"]", project.getBuildPlugins().get(i), Matchers.sameBeanAs(dummyPlugins.get(i)));
}
Assert.assertThat("Plugins["+dummyPlugins.size()+"]", project.getBuildPlugins().get(dummyPlugins.size()), Matchers.sameBeanAs(mergePlugin));
}
示例2: testMerge_pluginFoundWithExecutions
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
@Test
public void testMerge_pluginFoundWithExecutions() {
PluginExecution buildExec = new PluginExecution();
buildExec.setId("random-execution-id");
buildExec.setGoals(Arrays.asList("some-goal"));
buildExec.setPhase("random-phase");
buildExec.setPriority(1);
Plugin buildPlugin = new Plugin();
buildPlugin.setArtifactId("merge-artifact");
buildPlugin.addExecution(buildExec);
List<Plugin> plugins = project.getBuild().getPlugins();
plugins.addAll(dummyPlugins);
plugins.add(buildPlugin);
PluginExecution mergeExec = new PluginExecution();
mergeExec.setId("merge-execution-id");
mergeExec.setGoals(Arrays.asList("some-goal"));
mergeExec.setPhase("random-phase");
mergeExec.setPriority(1);
Plugin mergePlugin = new Plugin();
mergePlugin.setArtifactId("merge-artifact");
mergePlugin.getExecutions().add(mergeExec);
item.merge(project, mergePlugin);
Plugin expectedPlugin = new Plugin();
expectedPlugin.setArtifactId("merge-artifact");
expectedPlugin.getExecutions().add(buildExec);
expectedPlugin.getExecutions().add(mergeExec);
Assert.assertEquals("Plugins.Size", dummyPlugins.size() + 1, project.getBuildPlugins().size());
for (int i = 0; i < dummyPlugins.size(); i++) {
Assert.assertThat("Plugins["+i+"]", project.getBuildPlugins().get(i), Matchers.sameBeanAs(dummyPlugins.get(i)));
}
Assert.assertThat("Plugins["+dummyPlugins.size()+"]", project.getBuildPlugins().get(dummyPlugins.size()), Matchers.sameBeanAs(expectedPlugin));
}
示例3: testMerge_pluginFoundWithConflictingExecutions
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
@Test
public void testMerge_pluginFoundWithConflictingExecutions() {
PluginExecution buildExec = new PluginExecution();
buildExec.setId("merge-execution-id");
buildExec.setGoals(Arrays.asList("original-goal"));
buildExec.setPhase("original-phase");
buildExec.setPriority(1);
Plugin buildPlugin = new Plugin();
buildPlugin.setArtifactId("merge-artifact");
buildPlugin.addExecution(buildExec);
List<Plugin> plugins = project.getBuild().getPlugins();
plugins.addAll(dummyPlugins);
plugins.add(buildPlugin);
PluginExecution mergeExec = new PluginExecution();
mergeExec.setId("merge-execution-id");
mergeExec.setGoals(Arrays.asList("merge-goal"));
mergeExec.setPhase("merge-phase");
mergeExec.setPriority(2);
Plugin mergePlugin = new Plugin();
mergePlugin.setArtifactId("merge-artifact");
mergePlugin.getExecutions().add(mergeExec);
item.merge(project, mergePlugin);
Plugin expectedPlugin = new Plugin();
expectedPlugin.setArtifactId("merge-artifact");
expectedPlugin.getExecutions().add(buildExec);
Assert.assertEquals("Plugins.Size", dummyPlugins.size() + 1, project.getBuildPlugins().size());
for (int i = 0; i < dummyPlugins.size(); i++) {
Assert.assertThat("Plugins["+i+"]", project.getBuildPlugins().get(i), Matchers.sameBeanAs(dummyPlugins.get(i)));
}
Assert.assertThat("Plugins["+dummyPlugins.size()+"]", project.getBuildPlugins().get(dummyPlugins.size()), Matchers.sameBeanAs(expectedPlugin));
}
示例4: clone
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private PluginExecution clone(PluginExecution execution) {
PluginExecution clonedExecution = new PluginExecution();
clonedExecution.setId(execution.getId() + "-snapshot");
clonedExecution.setGoals(execution.getGoals());
clonedExecution.setPhase(execution.getPhase());
clonedExecution.setPriority(execution.getPriority());
return clonedExecution;
}
示例5: mergePluginExecution
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
@Override
protected void mergePluginExecution( PluginExecution target, PluginExecution source, boolean sourceDominant,
Map<Object, Object> context )
{
super.mergePluginExecution( target, source, sourceDominant, context );
target.setPriority( Math.min( target.getPriority(), source.getPriority() ) );
}
示例6: parseLifecyclePhaseDefinitions
import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private void parseLifecyclePhaseDefinitions( Map<Plugin, Plugin> plugins, String phase, String goals )
{
String[] mojos = StringUtils.split( goals, "," );
for ( int i = 0; i < mojos.length; i++ )
{
GoalSpec gs = parseGoalSpec( mojos[i].trim() );
if ( gs == null )
{
logger.warn( "Ignored invalid goal specification '" + mojos[i] + "' from lifecycle mapping for phase "
+ phase );
continue;
}
Plugin plugin = new Plugin();
plugin.setGroupId( gs.groupId );
plugin.setArtifactId( gs.artifactId );
plugin.setVersion( gs.version );
Plugin existing = plugins.get( plugin );
if ( existing != null )
{
if ( existing.getVersion() == null )
{
existing.setVersion( plugin.getVersion() );
}
plugin = existing;
}
else
{
plugins.put( plugin, plugin );
}
PluginExecution execution = new PluginExecution();
execution.setId( getExecutionId( plugin, gs.goal ) );
execution.setPhase( phase );
execution.setPriority( i - mojos.length );
execution.getGoals().add( gs.goal );
plugin.getExecutions().add( execution );
}
}