当前位置: 首页>>代码示例>>Java>>正文


Java Build.addExtension方法代码示例

本文整理汇总了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 );
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:11,代码来源:DefaultModelInheritanceAssembler.java

示例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
            )
        )
    );
}
 
开发者ID:jcabi,项目名称:jcabi-heroku-maven-plugin,代码行数:46,代码来源:DeployMojoTest.java

示例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 ) );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:14,代码来源:ProjectSorterTest.java


注:本文中的org.apache.maven.model.Build.addExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。