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

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(92)

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

Model.setLicenses介绍

[英]Set this element describes all of the licenses for this project. Each license is described by a license element, which is then described by additional elements. Projects should only list the license(s) that applies to the project and not the licenses that apply to dependencies. If multiple licenses are listed, it is assumed that the user can select any of them, not that they must accept all.
[中]设置此元素描述此项目的所有许可证。每个许可证由license元素描述,然后由其他元素描述。项目应仅列出适用于项目的许可证,而不是适用于依赖项的许可证。如果列出了多个许可证,则假定用户可以选择其中任何一个,而不是必须全部接受。

代码示例

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

public void setLicenses( List licenses )
{
  getModel().setLicenses( licenses );
}

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

public void setLicenses( List<License> licenses )
{
  getModel().setLicenses( licenses );
}

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

@Override
protected void mergeModel_Licenses( Model target, Model source, boolean sourceDominant,
                  Map<Object, Object> context )
{
  if ( target.getLicenses().isEmpty() )
  {
    target.setLicenses( new ArrayList<>( source.getLicenses() ) );
  }
}

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

protected void mergeModel_Licenses( Model target, Model source, boolean sourceDominant,
                  Map<Object, Object> context )
{
  List<License> src = source.getLicenses();
  if ( !src.isEmpty() )
  {
    List<License> tgt = target.getLicenses();
    Map<Object, License> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 );
    for ( License element : tgt )
    {
      Object key = getLicenseKey( element );
      merged.put( key, element );
    }
    for ( License element : src )
    {
      Object key = getLicenseKey( element );
      if ( sourceDominant || !merged.containsKey( key ) )
      {
        merged.put( key, element );
      }
    }
    target.setLicenses( new ArrayList<>( merged.values() ) );
  }
}

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

model.setLicenses( licenses );
while ( parser.nextTag() == XmlPullParser.START_TAG )

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

child.setLicenses( parent.getLicenses() );

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

child.setLicenses( parent.getLicenses() );

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

model.setLicenses( licenses );
while ( parser.nextTag() == XmlPullParser.START_TAG )

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

result.setInceptionYear( src.getInceptionYear() );
result.setIssueManagement( cloneIssueManagement( src.getIssueManagement() ) );
result.setLicenses( cloneList( src.getLicenses(), LICENSE_CLONER ) );

代码示例来源:origin: mojohaus/flatten-maven-plugin

@Override
  public void set( Model model, List<License> value )
  {
    model.setLicenses( value );
  };
};

代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.m2repo

@Override
public void setLicenses(List<License> licenses) {
  delegate.setLicenses(licenses);
}

代码示例来源:origin: ru.yandex.qatools.clay/clay-maven-settings-builder

/**
 * Set this element describes all of the licenses for this
 * project.
 *             Each license is described by a
 * <code>license</code> element, which
 *             is then described by additional elements.
 *             Projects should only list the license(s) that
 * applies to the project
 *             and not the licenses that apply to dependencies.
 *             If multiple licenses are listed, it is assumed
 * that the user can select
 *             any of them, not that they must accept all.
 *
 * @param licenses
 */
public FluentModelBuilder withLicenses(List<License> licenses) {
  model.setLicenses(licenses);
  return this;
}

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

model.setLicenses( licenses );
while ( parser.nextTag() == XmlPullParser.START_TAG )

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

@Override
protected void mergeModel_Licenses( Model target, Model source, boolean sourceDominant,
                  Map<Object, Object> context )
{
  if ( target.getLicenses().isEmpty() )
  {
    target.setLicenses( new ArrayList<>( source.getLicenses() ) );
  }
}

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

protected void mergeModel_Licenses( Model target, Model source, boolean sourceDominant,
                  Map<Object, Object> context )
{
  List<License> src = source.getLicenses();
  if ( !src.isEmpty() )
  {
    List<License> tgt = target.getLicenses();
    Map<Object, License> merged = new LinkedHashMap<Object, License>( ( src.size() + tgt.size() ) * 2 );
    for ( License element : tgt )
    {
      Object key = getLicenseKey( element );
      merged.put( key, element );
    }
    for ( License element : src )
    {
      Object key = getLicenseKey( element );
      if ( sourceDominant || !merged.containsKey( key ) )
      {
        merged.put( key, element );
      }
    }
    target.setLicenses( new ArrayList<License>( merged.values() ) );
  }
}

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

model.setDescription(
  configurationProperties.getProperty( Constants.ARCHETYPE_DESCRIPTION, project.getDescription() ) );
model.setLicenses( project.getLicenses() );
model.setDevelopers( project.getDevelopers() );
model.setScm( project.getScm() );

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

model.setLicenses( licenses );
while ( parser.nextTag() == XmlPullParser.START_TAG )

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

model.setLicenses( licenses );
while ( parser.nextTag() == XmlPullParser.START_TAG )

代码示例来源:origin: org.apache.maven.shared/maven-model-converter

model.setIssueManagement( translateIssueManagement( v3Model ) );
model.setLicenses( translateLicenses( v3Model.getLicenses() ) );
model.setMailingLists( translateMailingLists( v3Model.getMailingLists() ) );
model.setModelVersion( "4.0.0" );

代码示例来源:origin: mojohaus/flatten-maven-plugin

cleanPom.setVersion( effectivePom.getVersion() );
cleanPom.setPackaging( effectivePom.getPackaging() );
cleanPom.setLicenses( effectivePom.getLicenses() );

相关文章

Model类方法