本文整理了Java中org.apache.maven.model.Profile.setBuild()
方法的一些代码示例,展示了Profile.setBuild()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.setBuild()
方法的具体详情如下:
包路径:org.apache.maven.model.Profile
类名称:Profile
方法名:setBuild
[英]Set information required to build the project.
[中]设置生成项目所需的信息。
代码示例来源: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
profile.setBuild( parseBuildBase( parser, strict ) );
代码示例来源:origin: apache/maven
profile.setBuild( parseBuildBase( parser, strict, source ) );
代码示例来源: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: takari/polyglot-maven
profile.setBuild( parseBuildBase( parser, strict ) );
代码示例来源: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: 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: org.jboss.forge.addon/maven-impl-projects
profile.setBuild(new Build());
pom.getProfiles().add(profile);
if (build == null)
profile.setBuild(new Build());
build = profile.getBuild();
代码示例来源:origin: org.codehaus.mevenide/nb-project
act.setProperty(prop);
publicProfile.setActivation(act);
publicProfile.setBuild(new BuildBase());
model.addProfile(publicProfile);
markAsModified(model);
代码示例来源:origin: errai/errai
@Override
public boolean uninstall() {
final MavenFacet coreFacet = getProject().getFacet(MavenFacet.class);
final Model pom = coreFacet.getModel();
final Profile profile = MavenModelUtil.getProfileById(profileId, pom.getProfiles());
if (profile == null)
return false;
final BuildBase build = profile.getBuild();
if (build == null)
return false;
final Plugin plugin = build.getPluginsAsMap().get(getPluginArtifact().toString());
if (plugin == null)
return false;
build.removePlugin(plugin);
profile.setBuild(build);
coreFacet.setModel(pom);
return true;
}
代码示例来源:origin: org.switchyard/switchyard-forge-plugin
Profile buildOpenShiftProfile() throws Exception {
Model pom = project.getFacet(MavenCoreFacet.class).getPOM();
Profile profile = new Profile();
profile.setId(OPEN_SHIFT_PROFILE);
Build build = new Build();
build.setFinalName(pom.getArtifactId());
profile.setBuild(build);
addScannerPlugin(pom, profile);
Plugin jarPlugin = new Plugin();
jarPlugin.setGroupId("org.apache.maven.plugins");
jarPlugin.setArtifactId("maven-jar-plugin");
jarPlugin.setVersion("2.3.1");
String pluginConfig =
"<configuration>"
+ "<outputDirectory>deployments</outputDirectory>"
+ "</configuration>";
Xpp3Dom dom = Xpp3DomBuilder.build(new ByteArrayInputStream(pluginConfig.getBytes()), "UTF-8");
jarPlugin.setConfiguration(dom);
build.addPlugin(jarPlugin);
return profile;
}
代码示例来源:origin: io.tesla.maven/maven-model
profile.setBuild( parseBuildBase( parser, strict ) );
代码示例来源:origin: io.tesla.maven/maven-model
profile.setBuild( parseBuildBase( parser, strict, source ) );
代码示例来源:origin: errai/errai
profile.setBuild(new BuildBase());
内容来源于网络,如有侵权,请联系作者删除!