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

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

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

Build.setExtensions介绍

[英]Set a set of build extensions to use from this project.
[中]设置要从此项目中使用的一组生成扩展。

代码示例

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

public void setExtensions( List extensions )
{
  build.setExtensions( extensions );
}

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

public static void mergeExtensionLists( Build childBuild, Build parentBuild )
{
  Map extMap = new LinkedHashMap();
  List ext = childBuild.getExtensions();
  if ( ext != null )
  {
    for ( Iterator it = ext.iterator(); it.hasNext(); )
    {
      Extension extension = (Extension) it.next();
      extMap.put( extension.getKey(), extension );
    }
  }
  ext = parentBuild.getExtensions();
  if ( ext != null )
  {
    for ( Iterator it = ext.iterator(); it.hasNext(); )
    {
      Extension extension = (Extension) it.next();
      if ( !extMap.containsKey( extension.getKey() ) )
      {
        extMap.put( extension.getKey(), extension );
      }
    }
  }
  childBuild.setExtensions( new ArrayList( extMap.values() ) );
}

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

protected void mergeBuild_Extensions( Build target, Build source, boolean sourceDominant,
                   Map<Object, Object> context )
{
  List<Extension> src = source.getExtensions();
  if ( !src.isEmpty() )
  {
    List<Extension> tgt = target.getExtensions();
    Map<Object, Extension> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 );
    for ( Extension element : tgt )
    {
      Object key = getExtensionKey( element );
      merged.put( key, element );
    }
    for ( Extension element : src )
    {
      Object key = getExtensionKey( element );
      if ( sourceDominant || !merged.containsKey( key ) )
      {
        merged.put( key, element );
      }
    }
    target.setExtensions( new ArrayList<>( merged.values() ) );
  }
}

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

public static Build cloneBuild( Build src )
{
  if ( src == null )
  {
    return null;
  }
  Build result = new Build();
  
  cloneBuildBaseFields( src, result );
  
  result.setExtensions( cloneList( src.getExtensions(), EXTENSION_CLONER ) );
  result.setOutputDirectory( src.getOutputDirectory() );
  
  result.setScriptSourceDirectory( src.getScriptSourceDirectory() );
  result.setSourceDirectory( src.getSourceDirectory() );
  result.setTestOutputDirectory( src.getTestOutputDirectory() );
  result.setTestSourceDirectory( src.getTestSourceDirectory() );
  
  return result;
}

代码示例来源: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

build.setExtensions( extensions );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源:origin: takari/polyglot-maven

public BuildBuilder extensions(Extension... extensions) {
    if (extensions != null) {
      getBuild().setExtensions(Arrays.asList(extensions));
    }
    return this;
  }
}

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

build.setExtensions( extensions );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源:origin: takari/polyglot-maven

build.setExtensions(((BuildExtensionNamedValue)namedvalue).getExtensions());

代码示例来源:origin: takari/polyglot-maven

build.setExtensions( extensions );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源:origin: io.tesla.maven/maven-model

protected void mergeBuild_Extensions( Build target, Build source, boolean sourceDominant,
                   Map<Object, Object> context )
{
  List<Extension> src = source.getExtensions();
  if ( !src.isEmpty() )
  {
    List<Extension> tgt = target.getExtensions();
    Map<Object, Extension> merged = new LinkedHashMap<Object, Extension>( ( src.size() + tgt.size() ) * 2 );
    for ( Extension element : tgt )
    {
      Object key = getExtensionKey( element );
      merged.put( key, element );
    }
    for ( Extension element : src )
    {
      Object key = getExtensionKey( element );
      if ( sourceDominant || !merged.containsKey( key ) )
      {
        merged.put( key, element );
      }
    }
    target.setExtensions( new ArrayList<Extension>( merged.values() ) );
  }
}

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

releaseModel.getBuild().setExtensions( createReleaseExtensions( releaseDescriptor, 
                                releaseProject ) );

代码示例来源:origin: io.tesla.maven/maven-model

build.setExtensions( extensions );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源:origin: io.fabric8.forge/devops

extension.setVersion(EXTENSION_DAV_VERSION);
extensions.add(extension);
build.setExtensions(extensions);
changed = true;

代码示例来源:origin: io.tesla.maven/maven-model

build.setExtensions( extensions );
while ( parser.nextTag() == XmlPullParser.START_TAG )

相关文章