当前位置: 首页>>代码示例>>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;未经允许,请勿转载。