本文整理汇总了Java中org.apache.maven.model.Build.addExtension方法的典型用法代码示例。如果您正苦于以下问题:Java Build.addExtension方法的具体用法?Java Build.addExtension怎么用?Java Build.addExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Build
的用法示例。
在下文中一共展示了Build.addExtension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeExtensionLists
import org.apache.maven.model.Build; //导入方法依赖的package包/类
private static void mergeExtensionLists( Build childBuild, Build parentBuild )
{
for ( Extension e : parentBuild.getExtensions() )
{
if ( !childBuild.getExtensions().contains( e ) )
{
childBuild.addExtension( e );
}
}
}
示例2: velocityTemplateCorrectlyBuildsPomXml
import org.apache.maven.model.Build; //导入方法依赖的package包/类
/**
* DeployMojo can generate correct settings.xml file.
* @throws Exception If something is wrong
*/
@Test
public void velocityTemplateCorrectlyBuildsPomXml() throws Exception {
final Build build = new Build();
final Extension ext = new Extension();
ext.setArtifactId("test-foo");
build.addExtension(ext);
final MavenProject project = new MavenProject();
project.setBuild(build);
final String nspace = "http://maven.apache.org/POM/4.0.0";
MatcherAssert.assertThat(
new VelocityPage(
"com/jcabi/heroku/maven/plugin/pom.xml.vm"
).set("project", project)
.set("timestamp", "332211")
.set(
"deps",
Arrays.asList(
new DefaultArtifact("fooo", "", "", "", "", "", null)
)
)
.toString(),
Matchers.allOf(
XhtmlMatchers.hasXPath(
"//ns1:name[.='332211']",
nspace
),
XhtmlMatchers.hasXPath(
"//ns1:extension[ns1:artifactId='test-foo']",
nspace
),
XhtmlMatchers.hasXPath(
"//ns1:dependency[ns1:groupId='fooo']",
nspace
),
XhtmlMatchers.hasXPath(
"//ns1:configuration[ns1:outputDirectory='${basedir}']",
nspace
)
)
);
}
示例3: testShouldNotFailWhenProjectReferencesNonExistentProject
import org.apache.maven.model.Build; //导入方法依赖的package包/类
public void testShouldNotFailWhenProjectReferencesNonExistentProject()
throws CycleDetectedException, DuplicateProjectException
{
MavenProject project = createProject( "group", "artifact", "1.0" );
Build build = project.getModel().getBuild();
Extension extension = createExtension( "other.group", "other-artifact", "1.0" );
build.addExtension( extension );
new ProjectSorter( Collections.singletonList( project ) );
}