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

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

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

Model.setBuild介绍

[英]Set information required to build the project.
[中]设置生成项目所需的信息。

代码示例

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

public void setBuild( Build build )
{
  getModel().setBuild( build );
}

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

public void setBuild( Build build )
{
  getModel().setBuild( build );
}

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

private Build getModelBuild()
{
  Build build = getModel().getBuild();
  if ( build == null )
  {
    build = new Build();
    getModel().setBuild( build );
  }
  
  return build;
}

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

private void assembleBuildInheritance( Model child, Model parent )
{
  Build childBuild = child.getBuild();
  Build parentBuild = parent.getBuild();
  if ( parentBuild != null )
  {
    if ( childBuild == null )
    {
      childBuild = new Build();
      child.setBuild( childBuild );
    }
    assembleBuildInheritance( childBuild, parentBuild, true );
  }
}

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

private Build getModelBuild()
{
  Build build = getModel().getBuild();
  if ( build == null )
  {
    build = new Build();
    getModel().setBuild( build );
  }
  return build;
}

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

private void assembleBuildInheritance( Model child, Model parent )
{
  Build childBuild = child.getBuild();
  Build parentBuild = parent.getBuild();
  if ( parentBuild != null )
  {
    if ( childBuild == null )
    {
      childBuild = new Build();
      child.setBuild( childBuild );
    }
    assembleBuildInheritance( childBuild, parentBuild, true );
  }
}

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

protected void mergeModel_Build( Model target, Model source, boolean sourceDominant, Map<Object, Object> context )
{
  Build src = source.getBuild();
  if ( src != null )
  {
    Build tgt = target.getBuild();
    if ( tgt == null )
    {
      tgt = new Build();
      target.setBuild( tgt );
    }
    mergeBuild( tgt, src, sourceDominant, context );
  }
}

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

public void merge( Model target, Model source )
{
  if ( target.getBuild() == null )
  {
    target.setBuild( new Build() );
  }
  Map<Object, Object> context =
    Collections.<Object, Object>singletonMap( PLUGIN_MANAGEMENT, target.getBuild().getPluginManagement() );
  mergePluginContainer_Plugins( target.getBuild(), source.getBuild(), false, context );
}

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

@Override
public void injectProfile( Model model, Profile profile, ModelBuildingRequest request,
              ModelProblemCollector problems )
{
  if ( profile != null )
  {
    merger.mergeModelBase( model, profile );
    if ( profile.getBuild() != null )
    {
      if ( model.getBuild() == null )
      {
        model.setBuild( new Build() );
      }
      merger.mergeBuildBase( model.getBuild(), profile.getBuild() );
    }
  }
}

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

model.setBuild( ModelUtils.cloneBuild( dynamicBuild ) );
model.setBuild( dynamicBuild );

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

@Override
protected Build getBuild() {
  if (build == null) {
    build = new Build();
    model.setBuild(build);
  }
  return build;
}

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

model.setBuild( parseBuild( parser, strict ) );

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

model.setBuild( parseBuild( parser, strict, source ) );

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

model.setBuild( build );

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

model.setBuild( modelBuild );

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

model.setBuild(build);

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

result.setBuild( cloneBuild( src.getBuild() ) );
result.setCiManagement( cloneCiManagement( src.getCiManagement() ) );

代码示例来源:origin: mulesoft/mule

public File getArtifactPomFile() {
 if (artifactPomFile == null) {
  checkArgument(!isEmpty(artifactId), "Filename cannot be empty");
  final File tempFile = new File(getTempFolder(), artifactId + ".pom");
  tempFile.deleteOnExit();
  Model model = new Model();
  model.setGroupId(getGroupId());
  model.setArtifactId(getArtifactId());
  model.setVersion(getVersion());
  model.setModelVersion("4.0.0");
  if (!sharedLibraries.isEmpty()) {
   model.setBuild(new Build());
   model.getBuild().setPlugins(singletonList(createMuleMavenPlugin()));
  }
  for (AbstractDependencyFileBuilder fileBuilderDependency : dependencies) {
   model.addDependency(fileBuilderDependency.getAsMavenDependency());
  }
  artifactPomFile = new File(tempFile.getAbsolutePath());
  try (FileOutputStream fileOutputStream = new FileOutputStream(artifactPomFile)) {
   new MavenXpp3Writer().write(fileOutputStream, model);
  } catch (IOException e) {
   throw new MuleRuntimeException(e);
  }
 }
 return artifactPomFile;
}

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

private BuildBase getBuild(final Model model, String profileId) {
 if (profileId == null) {
  if (model.getBuild() == null) {
   model.setBuild(new Build());
  }
  return model.getBuild();
 } else {
  for (Profile p : model.getProfiles()) {
   if (profileId.equals(p.getId())) {
    if (p.getBuild() == null) {
     p.setBuild(new Build());
    }
    return p.getBuild();
   }
  }
  Profile profile = new Profile();
  profile.setId(profileId);
  profile.setBuild(new Build());
  model.addProfile(profile);
  return profile.getBuild();
 }
}

相关文章

Model类方法