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


Java Build.setPluginManagement方法代碼示例

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


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

示例1: testExecuteInParentWithConfigurationInPluginManagement

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

示例2: testExecuteInParentWithConfigurationInExecution

import org.apache.maven.model.Build; //導入方法依賴的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

示例3: createParentProject

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private MavenProject createParentProject() {
    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();
    plugin.setConfiguration( configuration );
    build.addPlugin( plugin );
    project.getOriginalModel().setBuild( build );
    return project;
}
 
開發者ID:mojohaus,項目名稱:extra-enforcer-rules,代碼行數:12,代碼來源:RequirePropertyDivergesTest.java

示例4: assembleBuildInheritance

import org.apache.maven.model.Build; //導入方法依賴的package包/類
@SuppressWarnings( "unchecked" )
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
{
    // The build has been set but we want to step in here and fill in
    // values that have not been set by the child.

    if ( childBuild.getSourceDirectory() == null )
    {
        childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
    }

    if ( childBuild.getScriptSourceDirectory() == null )
    {
        childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
    }

    if ( childBuild.getTestSourceDirectory() == null )
    {
        childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
    }

    if ( childBuild.getOutputDirectory() == null )
    {
        childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
    }

    if ( childBuild.getTestOutputDirectory() == null )
    {
        childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
    }

    // Extensions are accumulated
    mergeExtensionLists( childBuild, parentBuild );

    if ( childBuild.getDirectory() == null )
    {
        childBuild.setDirectory( parentBuild.getDirectory() );
    }

    if ( childBuild.getDefaultGoal() == null )
    {
        childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
    }

    if ( childBuild.getFinalName() == null )
    {
        childBuild.setFinalName( parentBuild.getFinalName() );
    }

    ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );

    List<Resource> resources = childBuild.getResources();
    if ( ( resources == null ) || resources.isEmpty() )
    {
        childBuild.setResources( parentBuild.getResources() );
    }

    resources = childBuild.getTestResources();
    if ( ( resources == null ) || resources.isEmpty() )
    {
        childBuild.setTestResources( parentBuild.getTestResources() );
    }

    // Plugins are aggregated if Plugin.inherit != false
    ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance );

    // Plugin management :: aggregate
    PluginManagement dominantPM = childBuild.getPluginManagement();
    PluginManagement recessivePM = parentBuild.getPluginManagement();

    if ( ( dominantPM == null ) && ( recessivePM != null ) )
    {
        // FIXME: Filter out the inherited == false stuff!
        childBuild.setPluginManagement( recessivePM );
    }
    else
    {
        ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:81,代碼來源:DefaultModelInheritanceAssembler.java

示例5: testShouldNotFailWhenManagedPluginDepReferencesCurrentProject

import org.apache.maven.model.Build; //導入方法依賴的package包/類
public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject()
    throws CycleDetectedException, DuplicateProjectException
{
    MavenProject project = createProject( "group", "artifact", "1.0" );

    Build build = project.getModel().getBuild();

    PluginManagement pMgmt = new PluginManagement();

    Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

    Dependency dep = createDependency( "group", "artifact", "1.0" );

    plugin.addDependency( dep );

    pMgmt.addPlugin( plugin );

    build.setPluginManagement( pMgmt );

    new ProjectSorter( Collections.singletonList( project ) );
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:22,代碼來源:ProjectSorterTest.java


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