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

x33g5p2x  于2022-01-26 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(108)

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

Profile.getBuild介绍

[英]Get information required to build the project.
[中]获取构建项目所需的信息。

代码示例

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

public static Profile cloneProfile( Profile src )
{
  if ( src == null )
  {
    return null;
  }
  
  Profile result = new Profile();
  
  cloneModelBaseFields( src, result );
  
  result.setActivation( cloneActivation( src.getActivation() ) );
  
  BuildBase resultBuild = null;
  if ( src.getBuild() != null )
  {
    resultBuild = new BuildBase();
    cloneBuildBaseFields( src.getBuild(), resultBuild );
  }
  result.setBuild( resultBuild );
  
  result.setId( src.getId() );
  result.setSource( src.getSource() );
  
  return result;
}

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

if ( profile.getBuild() != null )
  writeBuildBase( (BuildBase) profile.getBuild(), "build", serializer );

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

private void injectBuild( Profile profile, Model model )
  BuildBase profileBuild = profile.getBuild();
  Build modelBuild = model.getBuild();

代码示例来源: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();
 }
}

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

prefix + ".pluginRepositories.pluginRepository", request );
BuildBase buildBase = profile.getBuild();
if ( buildBase != null )

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

if (profile.getBuild() != null) {
  out.write("        " + "    " + ".build(" + br);
  out.write("        " + "        " + "profileBuild()" + br);
  writeBuildBase(profile.getBuild(), "        " + "            ");
  out.write("        " + "        " + ".endBuild()" + br);
  out.write("        " + "    " + ") //end of profile build section" + br);

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

if ( profile.getBuild() != null )
  writeBuildBase( (BuildBase) profile.getBuild(), "build", serializer );

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

managements( profile.getDependencyManagement(), profile.getBuild() );
build( profile.getBuild() );

代码示例来源:origin: org.sonatype.maven.archetype/archetype-common

private void mergeProfileBuild(Profile modelProfile, Profile generatedProfile) {
  if (generatedProfile.getBuild() != null) {
    if (modelProfile.getBuild() == null) {
      modelProfile.setBuild(new Build());
    }
    mergeBuildPlugins(modelProfile.getBuild(), generatedProfile.getBuild());
    // TODO: merge more than just plugins in the profile...
  }
}

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

private void mergeProfileBuild( Profile modelProfile, Profile generatedProfile )
{
  if ( generatedProfile.getBuild() != null )
  {
    if ( modelProfile.getBuild() == null )
    {
      modelProfile.setBuild( new Build() );
    }
    mergeBuildPlugins( modelProfile.getBuild(), generatedProfile.getBuild() );
    // TODO: merge more than just plugins in the profile...
  }
}

代码示例来源:origin: errai/errai

private void addTestResourcesFromTestProfile(final Map<String, Resource> resourcesByDirectory, final Profile testProfile) {
 if (testProfile.getBuild() == null)
  testProfile.setBuild(new BuildBase());
 if (testProfile.getBuild().getTestResources() != null) {
  for (final Resource resource : testProfile.getBuild().getTestResources()) {
   resourcesByDirectory.put(resource.getDirectory(), resource);
  }
 }
}

代码示例来源:origin: INRIA/spoon

javaVersion = getSourceVersion(profile.getBuild());

代码示例来源:origin: com.itemis.maven.plugins/unleash-maven-plugin

private Set<ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
 this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
 BuildBase build = profile.getBuild();
 if (build != null) {
  Collection<Plugin> snapshots = Collections2.filter(build.getPlugins(), new IsSnapshotPlugin(propertyResolver));
  return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
 }
 return Collections.emptySet();
}

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

private Set<ArtifactCoordinates> getSnapshots(Profile profile, PomPropertyResolver propertyResolver) {
 this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
 BuildBase build = profile.getBuild();
 if (build != null) {
  Collection<Plugin> snapshots = Collections2.filter(build.getPlugins(), new IsSnapshotPlugin(propertyResolver));
  return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
 }
 return Collections.emptySet();
}

代码示例来源:origin: com.itemis.maven.plugins/unleash-maven-plugin

private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
 this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
 BuildBase build = profile.getBuild();
 if (build != null) {
  PluginManagement pluginManagement = build.getPluginManagement();
  if (pluginManagement != null) {
   Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(),
     new IsSnapshotPlugin(propertyResolver));
   return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
  }
 }
 return Collections.emptySet();
}

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

private Set<ArtifactCoordinates> getSnapshotsFromManagement(Profile profile, PomPropertyResolver propertyResolver) {
 this.log.debug("\t\tChecking managed plugins of profile '" + profile.getId() + "'");
 BuildBase build = profile.getBuild();
 if (build != null) {
  PluginManagement pluginManagement = build.getPluginManagement();
  if (pluginManagement != null) {
   Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(),
     new IsSnapshotPlugin(propertyResolver));
   return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
  }
 }
 return Collections.emptySet();
}

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

private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshots(Profile profile,
  PomPropertyResolver propertyResolver) {
 this.log.debug("\t\tChecking direct plugin references of profile '" + profile.getId() + "'");
 Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
 BuildBase build = profile.getBuild();
 if (build != null) {
  for (Plugin plugin : build.getPlugins()) {
   Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(),
     new IsSnapshotDependency(propertyResolver));
   if (!snapshots.isEmpty()) {
    result.putAll(PluginToCoordinates.INSTANCE.apply(plugin),
      Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
   }
  }
 }
 return result;
}

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

@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: errai/errai

private void addTestResources(final Project project) {
 final MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
 final Model pom = mavenFacet.getModel();
 final Map<String, Resource> resourcesByDirectory = new HashMap<String, Resource>();
 final Profile testProfile = MavenModelUtil.getProfileById("integration-test", pom.getProfiles());
 
 addTestResourcesFromMainBuild(pom, resourcesByDirectory);
 addTestResourcesFromTestProfile(resourcesByDirectory, testProfile);
 maybeAddTestSourceDirectory(pom, resourcesByDirectory);
 
 testProfile.getBuild().setTestResources(new ArrayList<Resource>(resourcesByDirectory.values()));
 mavenFacet.setModel(pom);
}

相关文章