org.apache.maven.model.Build.getPlugins()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.apache.maven.model.Build.getPlugins()方法的一些代码示例,展示了Build.getPlugins()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Build.getPlugins()方法的具体详情如下:
包路径:org.apache.maven.model.Build
类名称:Build
方法名:getPlugins

Build.getPlugins介绍

暂无

代码示例

代码示例来源:origin: org.apache.maven/maven-project

public List getPlugins()
{
  return build.getPlugins();
}

代码示例来源:origin: org.apache.maven/maven-project

private void propagateNewPlugins( MavenProject project )
{
  Build changedBuild = project.getBuild();
  Build dynamicBuild = project.getDynamicBuild();
  
  if ( changedBuild == null || dynamicBuild == null )
  {
    return;
  }
  
  List changedPlugins = changedBuild.getPlugins();
  List dynamicPlugins = dynamicBuild.getPlugins();
  
  if ( changedPlugins != null && dynamicPlugins != null && changedPlugins.size() != dynamicPlugins.size() )
  {
    changedPlugins.removeAll( dynamicPlugins );
    if ( !changedPlugins.isEmpty() )
    {
      for ( Iterator it = changedPlugins.iterator(); it.hasNext(); )
      {
        Plugin plugin = (Plugin) it.next();
        
        dynamicBuild.addPlugin( plugin );
      }
    }
  }
  
  dynamicBuild.flushPluginMap();
}

代码示例来源:origin: org.apache.maven/maven-project

List buildPlugins = build.getPlugins();

代码示例来源:origin: org.apache.maven/maven-project

private void forcePluginExecutionIdCollision( final Model model, final ModelValidationResult result )
{
  Build build = model.getBuild();
  if ( build != null )
  {
    List plugins = build.getPlugins();
    if ( plugins != null )
    {
      for ( Iterator it = plugins.iterator(); it.hasNext(); )
      {
        Plugin plugin = (Plugin) it.next();
        // this will force an IllegalStateException, even if we don't have to do inheritance assembly.
        try
        {
          plugin.getExecutionsAsMap();
        }
        catch ( IllegalStateException collisionException )
        {
          result.addMessage( collisionException.getMessage() );
        }
      }
    }
  }
}

代码示例来源:origin: apache/maven

public List<Plugin> getBuildPlugins()
{
  if ( getModel().getBuild() == null )
  {
    return Collections.emptyList();
  }
  return Collections.unmodifiableList( getModel().getBuild().getPlugins() );
}

代码示例来源:origin: apache/maven

if ( build != null )
  List<Plugin> plugins = build.getPlugins();
  Map<Object, Plugin> normalized = new LinkedHashMap<>( plugins.size() * 2 );

代码示例来源:origin: org.apache.maven/maven-project

public List getBuildPlugins()
{
  if ( getModel().getBuild() == null )
  {
    return null;
  }
  return getModel().getBuild().getPlugins();
}

代码示例来源:origin: simpligility/android-maven-plugin

public static String getPluginConfigParameter ( MavenProject project, String parameter, String defaultValue )
{
  String value = null;
  for ( Plugin plugin : project.getBuild().getPlugins() )
  {
    if ( plugin.getArtifactId().equals( PluginInfo.getArtifactId() ) )
    {
      Xpp3Dom configuration = getMojoConfiguration( plugin );
      if ( configuration != null && configuration.getChild( parameter ) != null )
      {
       value = configuration.getChild( parameter ).getValue() ;
      }
    }
  }
  // if we got nothing, fall back to the default value
  return ( StringUtils.isEmpty( value ) ) ? defaultValue : value;
}

代码示例来源:origin: apache/maven

if ( build != null )
  for ( Plugin plugin : build.getPlugins() )

代码示例来源:origin: org.apache.maven/maven-project

private void mergeDeterministicBuildElements( Build interpolatedBuild,
                       Build dynamicBuild )
{
  mergeDeterministicPluginElements( interpolatedBuild.getPlugins(), dynamicBuild.getPlugins() );
  PluginManagement dPluginMgmt = dynamicBuild.getPluginManagement();
  PluginManagement iPluginMgmt = interpolatedBuild.getPluginManagement();
  if ( dPluginMgmt != null )
  {
    mergeDeterministicPluginElements( iPluginMgmt.getPlugins(), dPluginMgmt.getPlugins() );
  }
  if ( dynamicBuild.getExtensions() != null )
  {
    dynamicBuild.setExtensions( interpolatedBuild.getExtensions() );
  }
}

代码示例来源:origin: apache/maven

@Override
public void injectDefaultValues( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
  injectDependencyDefaults( model.getDependencies() );
  Build build = model.getBuild();
  if ( build != null )
  {
    for ( Plugin plugin : build.getPlugins() )
    {
      injectDependencyDefaults( plugin.getDependencies() );
    }
  }
}

代码示例来源:origin: apache/maven

if ( build != null )
  for ( Plugin plugin : build.getPlugins() )

代码示例来源:origin: apache/maven

private Plugin findSitePlugin( Build build )
{
  for ( Plugin plugin : build.getPlugins() )
  {
    if ( isSitePlugin( plugin ) )
    {
      return plugin;
    }
  }
  PluginManagement pluginManagement = build.getPluginManagement();
  if ( pluginManagement != null )
  {
    for ( Plugin plugin : pluginManagement.getPlugins() )
    {
      if ( isSitePlugin( plugin ) )
      {
        return plugin;
      }
    }
  }
  return null;
}

代码示例来源:origin: apache/maven

@Override
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() );
    }
  }
}

代码示例来源:origin: apache/maven

for ( Plugin plugin : project.getBuild().getPlugins() )

代码示例来源:origin: apache/maven

for ( Plugin plugin : build.getPlugins() )

代码示例来源:origin: apache/maven

public void injectLifecycleBindings( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
{
  String packaging = model.getPackaging();
  Collection<Plugin> defaultPlugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles( packaging );
  if ( defaultPlugins == null )
  {
    problems.add( new ModelProblemCollectorRequest( Severity.ERROR, Version.BASE )
        .setMessage( "Unknown packaging: " + packaging )
        .setLocation( model.getLocation( "packaging" ) ) );
  }
  else if ( !defaultPlugins.isEmpty() )
  {
    Model lifecycleModel = new Model();
    lifecycleModel.setBuild( new Build() );
    lifecycleModel.getBuild().getPlugins().addAll( defaultPlugins );
    merger.merge( model, lifecycleModel );
  }
}

代码示例来源:origin: org.apache.maven/maven-project

if ( build != null )
  for ( Iterator it = build.getPlugins().iterator(); it.hasNext(); )

代码示例来源:origin: apache/maven

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;
}

代码示例来源:origin: apache/maven

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;
}

相关文章