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


Java Build.getPluginManagement方法代码示例

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


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

示例1: getSnapshotsFromManagement

import org.apache.maven.model.Build; //导入方法依赖的package包/类
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins");
  Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
  Build build = project.getBuild();
  if (build != null) {
    PluginManagement pluginManagement = build.getPluginManagement();
    if (pluginManagement != null) {
      for (Plugin plugin : pluginManagement.getPlugins()) {
        Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(),
            new IsSnapshotDependency(propertyResolver));
        if (!snapshots.isEmpty()) {
          result.putAll(PluginToCoordinates.INSTANCE.apply(plugin),
              Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
        }
      }
    }
  }
  return result;
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:21,代码来源:CheckPluginDependencyVersions.java

示例2: getRuleConfigurations

import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
 * Returns the rule configurations from the <tt>pluginManagement</tt> as well
 * as the <tt>plugins</tt> section.
 *
 * @param build the build to inspect.
 * @return configuration of the rules, may be an empty list.
 */
final List<Xpp3Dom> getRuleConfigurations( final Build build )
{
    @SuppressWarnings( "unchecked" )
    final Map<String, Plugin> plugins = build.getPluginsAsMap();
    final List<Xpp3Dom> ruleConfigurationsForPlugins = getRuleConfigurations( plugins );
    final PluginManagement pluginManagement = build.getPluginManagement();
    if ( pluginManagement != null )
    {
        @SuppressWarnings( "unchecked" )
        final Map<String, Plugin> pluginsFromManagementAsMap = pluginManagement.getPluginsAsMap();
        List<Xpp3Dom> ruleConfigurationsFromManagement = getRuleConfigurations( pluginsFromManagementAsMap );
        ruleConfigurationsForPlugins.addAll( ruleConfigurationsFromManagement );
    }
    return ruleConfigurationsForPlugins;
}
 
开发者ID:mojohaus,项目名称:extra-enforcer-rules,代码行数:23,代码来源:RequirePropertyDiverges.java

示例3: extractPluginDependenciesFromPluginsInPluginManagement

import org.apache.maven.model.Build; //导入方法依赖的package包/类
private static Set<Dependency> extractPluginDependenciesFromPluginsInPluginManagement( Build build )
{
    Set<Dependency> result = new TreeSet<>( new DependencyComparator() );
    if ( build.getPluginManagement() != null )
    {
        for ( Plugin plugin : build.getPluginManagement().getPlugins() )
        {
            if ( plugin.getDependencies() != null && !plugin.getDependencies().isEmpty() )
            {
                for ( Dependency pluginDependency : plugin.getDependencies() )
                {
                    result.add( pluginDependency );
                }
            }
        }
    }
    return result;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:19,代码来源:DisplayDependencyUpdatesMojo.java

示例4: resolveFromProject

import org.apache.maven.model.Build; //导入方法依赖的package包/类
private PluginPrefixResult resolveFromProject( PluginPrefixRequest request )
{
    PluginPrefixResult result = null;

    if ( request.getPom() != null && request.getPom().getBuild() != null )
    {
        Build build = request.getPom().getBuild();

        result = resolveFromProject( request, build.getPlugins() );

        if ( result == null && build.getPluginManagement() != null )
        {
            result = resolveFromProject( request, build.getPluginManagement().getPlugins() );
        }
    }

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

示例5: resolveFromProject

import org.apache.maven.model.Build; //导入方法依赖的package包/类
private PluginVersionResult resolveFromProject( PluginVersionRequest request )
{
    PluginVersionResult result = null;

    if ( request.getPom() != null && request.getPom().getBuild() != null )
    {
        Build build = request.getPom().getBuild();

        result = resolveFromProject( request, build.getPlugins() );

        if ( result == null && build.getPluginManagement() != null )
        {
            result = resolveFromProject( request, build.getPluginManagement().getPlugins() );
        }
    }

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

示例6: expandPluginConfiguration

import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
    Build build = model.getBuild();

    if ( build != null )
    {
        expand( build.getPlugins() );

        PluginManagement pluginManagement = build.getPluginManagement();

        if ( pluginManagement != null )
        {
            expand( pluginManagement.getPlugins() );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:DefaultPluginConfigurationExpander.java

示例7: getSnapshotsFromManagement

import org.apache.maven.model.Build; //导入方法依赖的package包/类
private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins");
  Build build = project.getBuild();
  if (build != null) {
    PluginManagement pluginManagement = build.getPluginManagement();
    if (pluginManagement != null) {
      Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(),
          new IsSnapshotPlugin(propertyResolver));
      return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
    }
  }
  return Collections.emptySet();
}
 
开发者ID:shillner,项目名称:unleash-maven-plugin,代码行数:15,代码来源:CheckPluginVersions.java

示例8: getManagedPluginMap

import org.apache.maven.model.Build; //导入方法依赖的package包/类
public Map<String, Plugin> getManagedPluginMap( final ModelBase base )
{
    if ( base instanceof Model )
    {
        final Build build = ( (Model) base ).getBuild();
        if ( build == null )
        {
            return Collections.emptyMap();
        }

        final PluginManagement pm = build.getPluginManagement();
        if ( pm == null )
        {
            return Collections.emptyMap();
        }

        final Map<String, Plugin> result = pm.getPluginsAsMap();
        if ( result == null )
        {
            return Collections.emptyMap();
        }

        return result;
    }

    return Collections.emptyMap();
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:28,代码来源:Project.java

示例9: getPluginManagement

import org.apache.maven.model.Build; //导入方法依赖的package包/类
public PluginManagement getPluginManagement()
{
    PluginManagement pluginMgmt = null;

    Build build = getModel().getBuild();
    if ( build != null )
    {
        pluginMgmt = build.getPluginManagement();
    }

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

示例10: mergeManagedBuildPlugins

import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void mergeManagedBuildPlugins( Model model )
{
    Build build = model.getBuild();
    if ( build != null )
    {
        PluginManagement pluginManagement = build.getPluginManagement();
        if ( pluginManagement != null )
        {
            mergePluginContainer_Plugins( build, pluginManagement );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:13,代码来源:DefaultPluginManagementInjector.java

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