當前位置: 首頁>>代碼示例>>Java>>正文


Java Plugin.addExecution方法代碼示例

本文整理匯總了Java中org.apache.maven.model.Plugin.addExecution方法的典型用法代碼示例。如果您正苦於以下問題:Java Plugin.addExecution方法的具體用法?Java Plugin.addExecution怎麽用?Java Plugin.addExecution使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.model.Plugin的用法示例。


在下文中一共展示了Plugin.addExecution方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
protected Plugin createPlugin(String groupId, String artifactId, String version, String configuration,
		String executionId, String goal, String phase) throws MavenExecutionException {
	Plugin plugin = new Plugin();
	plugin.setGroupId(groupId);
	plugin.setArtifactId(artifactId);
	plugin.setVersion(version);

	PluginExecution execution = new PluginExecution();
	execution.setId(executionId);
	execution.addGoal(goal);
	if (phase != null) {
		execution.setPhase(phase);
	}
	if (configuration != null) {
		execution.setConfiguration(mavenConfig.asXpp3Dom(configuration));
	}
	plugin.addExecution(execution);

	return plugin;
}
 
開發者ID:commsen,項目名稱:EM,代碼行數:21,代碼來源:DynamicMavenPlugin.java

示例2: getEnforcerPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
public Plugin getEnforcerPlugin(MavenProject project)
        throws MavenExecutionException {
    StringBuilder configString = new StringBuilder()
            .append("<configuration><rules>")
            .append("<requireReleaseDeps><message>No Snapshots Allowed!</message><excludes><exclude>"+project.getGroupId()+":*</exclude></excludes></requireReleaseDeps>")
            .append("</rules></configuration>");
    Xpp3Dom config = null;
    try {
        config = Xpp3DomBuilder.build(new StringReader(configString.toString()));
    } catch (XmlPullParserException | IOException ex) {
        throw new MavenExecutionException("Issue creating cofig for enforcer plugin", ex);
    }

    PluginExecution execution = new PluginExecution();
    execution.setId("no-snapshot-deps");
    execution.addGoal("enforce");
    execution.setConfiguration(config);

    Plugin result = new Plugin();
    result.setArtifactId("maven-enforcer-plugin");
    result.setVersion("1.4.1");
    result.addExecution(execution);

    return result;
}
 
開發者ID:IG-Group,項目名稱:cdversion-maven-extension,代碼行數:26,代碼來源:Plugins.java

示例3: testExecuteInParentWithConfigurationInExecution

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
/**
 * Test of execute method, of class RequirePropertyDiverges.
 */
@Test
public void testExecuteInParentWithConfigurationInExecution() throws EnforcerRuleException
{
    RequirePropertyDiverges mockInstance = createMockRule();
    final MavenProject project = createMavenProject( "company", "company-parent-pom" );
    final Build build = new Build();
    build.setPluginManagement( new PluginManagement() );
    final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0" );
    final Xpp3Dom configuration = createPluginConfiguration();
    PluginExecution pluginExecution = new PluginExecution();
    pluginExecution.setConfiguration( configuration );
    plugin.addExecution( pluginExecution );
    build.addPlugin( plugin );
    project.getOriginalModel().setBuild( build );
    setUpHelper(project, "parentValue");
    mockInstance.execute( helper );
}
 
開發者ID:mojohaus,項目名稱:extra-enforcer-rules,代碼行數:21,代碼來源:RequirePropertyDivergesTest.java

示例4: getVersionFixPlugin

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
public Plugin getVersionFixPlugin() {
    PluginExecution execution = new PluginExecution();
    execution.setId("versionfix");
    execution.addGoal("versionfix");

    Plugin result = new Plugin();
    result.setGroupId("com.iggroup.maven.cdversion");
    result.setArtifactId("versionfix-maven-plugin");
    result.setVersion("${project.version}");
    result.addExecution(execution);
    
    return result;
}
 
開發者ID:IG-Group,項目名稱:cdversion-maven-extension,代碼行數:14,代碼來源:Plugins.java

示例5: testMerge_pluginFoundWithExecutions

import org.apache.maven.model.Plugin; //導入方法依賴的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));
}
 
開發者ID:IG-Group,項目名稱:cdversion-maven-extension,代碼行數:40,代碼來源:PluginMergerTest.java

示例6: testMerge_pluginFoundWithConflictingExecutions

import org.apache.maven.model.Plugin; //導入方法依賴的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));
}
 
開發者ID:IG-Group,項目名稱:cdversion-maven-extension,代碼行數:39,代碼來源:PluginMergerTest.java

示例7: addPluginExecution

import org.apache.maven.model.Plugin; //導入方法依賴的package包/類
private void addPluginExecution(Plugin plugin, String goal, Phase phase) {
	PluginExecution pluginExecution = new PluginExecution();
	pluginExecution.addGoal(goal);
	pluginExecution.setPhase(phase.toString());
	plugin.addExecution(pluginExecution);
}
 
開發者ID:javabuild,項目名稱:builder-parent,代碼行數:7,代碼來源:MavenBuilderExtension.java


注:本文中的org.apache.maven.model.Plugin.addExecution方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。