当前位置: 首页>>代码示例>>Java>>正文


Java PluginExecution.addGoal方法代码示例

本文整理汇总了Java中org.apache.maven.model.PluginExecution.addGoal方法的典型用法代码示例。如果您正苦于以下问题:Java PluginExecution.addGoal方法的具体用法?Java PluginExecution.addGoal怎么用?Java PluginExecution.addGoal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.model.PluginExecution的用法示例。


在下文中一共展示了PluginExecution.addGoal方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的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.PluginExecution; //导入方法依赖的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: newPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
private Plugin newPlugin( String artifactId, String... goals )
{
    Plugin plugin = new Plugin();

    plugin.setGroupId( "org.apache.maven.plugins" );
    plugin.setArtifactId( artifactId );

    for ( String goal : goals )
    {
        PluginExecution pluginExecution = new PluginExecution();
        pluginExecution.setId( "default-" + goal );
        pluginExecution.addGoal( goal );
        plugin.addExecution( pluginExecution );
    }

    return plugin;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:18,代码来源:EmptyLifecycleExecutor.java

示例4: getVersionFixPlugin

import org.apache.maven.model.PluginExecution; //导入方法依赖的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: testShouldNotMergePluginExecutionWhenExecInheritedIsFalseAndTreatAsInheritanceIsTrue

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
public void testShouldNotMergePluginExecutionWhenExecInheritedIsFalseAndTreatAsInheritanceIsTrue()
{
    String gid = "group";
    String aid = "artifact";
    String ver = "1";

    PluginContainer parent = new PluginContainer();
    Plugin pParent = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );

    pParent.setInherited( Boolean.toString( true ) );

    PluginExecution eParent = new PluginExecution();

    String testId = "test";

    eParent.setId( testId );
    eParent.addGoal( "run" );
    eParent.setPhase( "initialize" );
    eParent.setInherited( Boolean.toString( false ) );

    pParent.addExecution( eParent );
    parent.addPlugin( pParent );

    PluginContainer child = new PluginContainer();
    Plugin pChild = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );
    PluginExecution eChild = new PluginExecution();

    eChild.setId( "child-specified" );
    eChild.addGoal( "child" );
    eChild.setPhase( "compile" );

    pChild.addExecution( eChild );
    child.addPlugin( pChild );

    ModelUtils.mergePluginDefinitions( pChild, pParent, true );

    Map executionMap = pChild.getExecutionsAsMap();
    assertNull( "test execution should not be inherited from parent.", executionMap.get( testId ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:ModelUtilsTest.java

示例6: testShouldNotMergePluginExecutionWhenPluginInheritedIsFalseAndTreatAsInheritanceIsTrue

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
public void testShouldNotMergePluginExecutionWhenPluginInheritedIsFalseAndTreatAsInheritanceIsTrue()
{
    String gid = "group";
    String aid = "artifact";
    String ver = "1";

    PluginContainer parent = new PluginContainer();
    Plugin pParent = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );

    pParent.setInherited( Boolean.toString( false ) );

    PluginExecution eParent = new PluginExecution();

    String testId = "test";

    eParent.setId( testId );
    eParent.addGoal( "run" );
    eParent.setPhase( "initialize" );
    eParent.setInherited( Boolean.toString( true ) );

    pParent.addExecution( eParent );
    parent.addPlugin( pParent );

    PluginContainer child = new PluginContainer();
    Plugin pChild = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );
    PluginExecution eChild = new PluginExecution();

    eChild.setId( "child-specified" );
    eChild.addGoal( "child" );
    eChild.setPhase( "compile" );

    pChild.addExecution( eChild );
    child.addPlugin( pChild );

    ModelUtils.mergePluginDefinitions( pChild, pParent, true );

    Map executionMap = pChild.getExecutionsAsMap();
    assertNull( "test execution should not be inherited from parent.", executionMap.get( testId ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:ModelUtilsTest.java

示例7: testShouldMergePluginExecutionWhenExecInheritedIsTrueAndTreatAsInheritanceIsTrue

import org.apache.maven.model.PluginExecution; //导入方法依赖的package包/类
public void testShouldMergePluginExecutionWhenExecInheritedIsTrueAndTreatAsInheritanceIsTrue()
{
    String gid = "group";
    String aid = "artifact";
    String ver = "1";

    PluginContainer parent = new PluginContainer();
    Plugin pParent = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );

    pParent.setInherited( Boolean.toString( true ) );

    PluginExecution eParent = new PluginExecution();

    String testId = "test";

    eParent.setId( testId );
    eParent.addGoal( "run" );
    eParent.setPhase( "initialize" );
    eParent.setInherited( Boolean.toString( true ) );

    pParent.addExecution( eParent );
    parent.addPlugin( pParent );

    PluginContainer child = new PluginContainer();
    Plugin pChild = createPlugin( gid, aid, ver, Collections.EMPTY_MAP );
    PluginExecution eChild = new PluginExecution();

    eChild.setId( "child-specified" );
    eChild.addGoal( "child" );
    eChild.setPhase( "compile" );

    pChild.addExecution( eChild );
    child.addPlugin( pChild );

    ModelUtils.mergePluginDefinitions( pChild, pParent, true );

    Map executionMap = pChild.getExecutionsAsMap();
    assertNotNull( "test execution should be inherited from parent.", executionMap.get( testId ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:ModelUtilsTest.java

示例8: addPluginExecution

import org.apache.maven.model.PluginExecution; //导入方法依赖的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.PluginExecution.addGoal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。