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

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

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

Model.setProperties介绍

[英]Set Project properties that will be used by various plugins. The format is <name>value</name>.
[中]设置各种插件将使用的项目属性。格式为<name>value</name>

代码示例

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

public void inject( Profile profile, Model model )
{
  model.setDependencies( injectDependencies( profile.getDependencies(), model.getDependencies() ) );
  injectModules( profile, model );
  model.setRepositories( ModelUtils.mergeRepositoryLists( profile.getRepositories(), model.getRepositories() ) );
  model.setPluginRepositories( ModelUtils.mergeRepositoryLists( profile.getPluginRepositories(), model
    .getPluginRepositories() ) );
  injectReporting( profile, model );
  injectDependencyManagement( profile, model );
  injectDistributionManagement( profile, model );
  injectBuild( profile, model );
  Properties props = new Properties();
  props.putAll( model.getProperties() );
  props.putAll( profile.getProperties() );
  model.setProperties( props );
}

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

props.putAll( child.getProperties() );
child.setProperties( props );

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

props.putAll( child.getProperties() );
child.setProperties( props );

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

@Override
  public void set( Model model, Properties value )
  {
    model.setProperties( value );
  };
};

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

/**
 * Set properties that can be used throughout the POM as a
 * substitution, and
 *             are used as filters in resources if enabled.
 *             The format is
 * <code>&lt;name&gt;value&lt;/name&gt;</code>.
 *
 * @param properties
 */
public FluentModelBuilder withProperties(Properties properties) {
  model.setProperties(properties);
  return this;
}

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

@Override
public void setProperties(Properties properties) {
  delegate.setProperties(properties);
}

代码示例来源:origin: org.codehaus.mojo/platform-detector-maven-plugin

private void set( String key, String value )
{
  System.setProperty( key, value );
  
  Model model = project.getModel();
  
  Properties modelProps = model.getProperties();
  modelProps.setProperty( key, value );
  
  model.setProperties( modelProps );
}

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

public void injectProfile( Model model, Profile profile, ModelBuildingRequest request,
                ModelProblemCollector problems )
  {
    List<String> activeProfileIds = request.getActiveProfileIds();
    if ( activeProfileIds.contains( profile.getId() ) )
    {
      Properties merged = new Properties();
      merged.putAll( model.getProperties() );
      merged.putAll( profile.getProperties() );
      model.setProperties( merged );
    }
  }
};

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

modelProperties.setProperty(p.getKey(), p.getValue());
model.setProperties(modelProperties);

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

properties.setProperty("nar.aol", this.aolId.toString());
properties.setProperty("nar.aol.key", this.aolId.getKey());
model.setProperties(properties);

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

/**
 * Removes a lot of unnecessary information from the POM.
 * This includes the build section, reporting, repositories, etc.
 */
public void trimModel( Model model )
{
  model.setBuild( null );
  model.setReporting( null );
  model.setProperties( null );
  model.setRepositories( null );
  model.setPluginRepositories( null );
  model.setProfiles( null );
  model.setDistributionManagement( null );
  model.setModules( null );
}

代码示例来源:origin: org.jboss.forge.addon/maven-impl

private void initialize()
  {
   if (isStale() || currentModel == null)
   {
     try (InputStream stream = getResourceInputStream())
     {
      MavenXpp3Reader reader = new MavenXpp3Reader();
      currentModel = reader.read(stream);
      currentModel.setPomFile(getUnderlyingResourceObject());

      // FORGE-2273: Making properties sortable
      SortedProperties sortedProps = new SortedProperties();
      sortedProps.putAll(currentModel.getProperties());
      currentModel.setProperties(sortedProps);
     }
     catch (Exception e)
     {
      throw new RuntimeException("Could not parse POM file: " + getFullyQualifiedName(), e);
     }
     finally
     {
      refresh();
     }
   }
  }
}

代码示例来源:origin: org.apache.maven.plugins/maven-eclipse-plugin

model.setVersion( version );
model.setProperties( plugin.getPomProperties() );

代码示例来源:origin: io.tesla.polyglot/tesla-polyglot-atom

modelProperties.setProperty(p.getKey(), p.getValue());
model.setProperties(modelProperties);

代码示例来源:origin: io.takari.polyglot/polyglot-atom

modelProperties.setProperty(p.getKey(), p.getValue());
model.setProperties(modelProperties);

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

model.setUrl( v3Model.getUrl() );
model.setProperties( properties );

相关文章

Model类方法