當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。