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


Java Build.getDefaultGoal方法代碼示例

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


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

示例1: isActionEnable

import org.apache.maven.model.Build; //導入方法依賴的package包/類
public static boolean isActionEnable(String action, NbMavenProjectImpl project, Lookup lookup) {
   
    PackagingProvider packProv = new PackagingProvider(project);
    M2ConfigProvider configs = project.getLookup().lookup(M2ConfigProvider.class);
    M2Configuration activeConfiguration = configs.getActiveConfiguration();        
    if(isActionEnable(activeConfiguration, action, project, packProv, lookup)) {
        return true;
    }
    //check fallback default config as well..
    if(isActionEnable(configs.getDefaultConfig(), action, project, packProv, lookup)) {
        return true;
    }
    if (ActionProvider.COMMAND_BUILD.equals(action) ||
            ActionProvider.COMMAND_REBUILD.equals(action)) {
        Build bld = project.getOriginalMavenProject().getBuild();
        if (bld != null) {
            String goal = bld.getDefaultGoal();
            if (goal != null && goal.trim().length() > 0) {
                return true;
            }
        }
    }
    
    for (MavenActionsProvider add : actionProviders(project)) {
        if(isActionEnable(add, action, project, packProv, lookup)) {
            return true;
        }
    }
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:31,代碼來源:ActionToGoalUtils.java

示例2: 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


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