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


Java CoordinateBuilder类代码示例

本文整理汇总了Java中org.jboss.forge.addon.dependencies.builder.CoordinateBuilder的典型用法代码示例。如果您正苦于以下问题:Java CoordinateBuilder类的具体用法?Java CoordinateBuilder怎么用?Java CoordinateBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CoordinateBuilder类属于org.jboss.forge.addon.dependencies.builder包,在下文中一共展示了CoordinateBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installMavenPluginDependencies

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public void installMavenPluginDependencies() {
    Coordinate jbakeMavenCompiler = CoordinateBuilder.create(BR_COM_INGENIEUX_JBAKE_MAVEN_PLUGIN);
    Coordinate mavenWarCompiler = CoordinateBuilder.create(ORG_APACHE_MAVEN_PLUGINS_MAVEN_WAR_PLUGIN).setVersion("2.4");

    MavenPluginBuilder jbakeBuilder = MavenPluginBuilder.create()
            .setCoordinate(jbakeMavenCompiler).addExecution(ExecutionBuilder.create().setId("default-generate").setPhase("generate-resources").addGoal("generate"))
            .setConfiguration(ConfigurationBuilder.create().addConfigurationElement(ConfigurationElementBuilder.create().addChild("listenAddress").setText(listenAddress))
                    .addConfigurationElement(ConfigurationElementBuilder.create().addChild("port").setText(port))).addPluginDependency(JBAKE_CORE_DEPENDENCY).addPluginDependency(JBAKE_FREEMARKER_TEMPLATE_ENGINE_DEPENDENCY)
            .addPluginDependency(JBAKE_PEGDOWN_TEMPLATE_ENGINE_DEPENDENCY);
    MavenPluginBuilder mavenWarBuilder = MavenPluginBuilder.create().setCoordinate(mavenWarCompiler).setConfiguration(ConfigurationBuilder.create()
            .addConfigurationElement(ConfigurationElementBuilder.create()
                    .addChild("failOnMissingWebXml").setText("false")));

    MavenPlugin mavenWarPlugin = new MavenPluginAdapter(mavenWarBuilder);
    MavenPlugin jbakePlugin = new MavenPluginAdapter(jbakeBuilder);

    MavenPluginFacet pluginFacet = getFaceted().getFacet(MavenPluginFacet.class);

    pluginFacet.addPlugin(jbakePlugin);
    pluginFacet.addPlugin(mavenWarPlugin);
}
 
开发者ID:jbake-org,项目名称:jbake-forge-addon,代码行数:23,代码来源:JBakeFacetImpl_2_0.java

示例2: getCoordinate

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public Coordinate getCoordinate(String sha1)
{
    return this.findSingle(DocTo.Fields.SHA1, sha1, new DocTo<Coordinate>()
    {
        public Coordinate convert(Document doc)
        {
            return CoordinateBuilder.create()
                .setGroupId(doc.get(GROUP_ID))
                .setArtifactId(doc.get(ARTIFACT_ID))
                .setVersion(doc.get(VERSION))
                .setClassifier(doc.get(CLASSIFIER))
                .setPackaging(doc.get(PACKAGING));
        }
    });
}
 
开发者ID:windup,项目名称:windup,代码行数:17,代码来源:LuceneArchiveIdentificationService.java

示例3: getLatestReleaseOf

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
/**
 * @return Finds the latest non-SNAPSHOT of given artifact.
 */
public Coordinate getLatestReleaseOf(final CoordinateBuilder coord)
{
    List<Coordinate> availableVersions = depsResolver.resolveVersions(DependencyQueryBuilder.create(coord));

    // Find the latest non-SNAPSHOT and non-CR version.
    for(int i = availableVersions.size()-1; i >= 0; i--)
    {
        Coordinate availableCoord = availableVersions.get(i);
        String versionStr = availableCoord.getVersion();

        if(versionStr != null && !availableCoord.isSnapshot() && !versionStr.matches(".*CR[0-9]$"))
            return availableCoord;
    }
    return null;
}
 
开发者ID:windup,项目名称:windup,代码行数:19,代码来源:RulesetsUpdater.java

示例4: createCoordinate

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
protected Coordinate createCoordinate(String groupId, String artifactId, String version, String packaging) {
    CoordinateBuilder builder = CoordinateBuilder.create()
            .setGroupId(groupId)
            .setArtifactId(artifactId);
    if (version != null) {
        builder = builder.setVersion(version);
    }
    if (packaging != null) {
        builder = builder.setPackaging(packaging);
    }

    return builder;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:14,代码来源:AbstractFabricProjectCommand.java

示例5: createCoordinate

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
public static Coordinate createCoordinate(String groupId, String artifactId, String version, String packaging) {
    CoordinateBuilder builder = CoordinateBuilder.create()
            .setGroupId(groupId)
            .setArtifactId(artifactId);
    if (version != null) {
        builder = builder.setVersion(version);
    }
    if (packaging != null) {
        builder = builder.setPackaging(packaging);
    }

    return builder;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:14,代码来源:MavenHelpers.java

示例6: getArchetypeCatalog

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public ArchetypeCatalog getArchetypeCatalog() {
    if (cachedArchetypes == null) {
        String version = VersionHelper.fabric8ArchetypesVersion();

        Coordinate coordinate = CoordinateBuilder.create()
                .setGroupId("io.fabric8.archetypes")
                .setArtifactId("archetypes-catalog")
                .setVersion(version)
                .setPackaging("jar");

        // load the archetype-catalog.xml from inside the JAR
        Dependency dependency = resolver.get().resolveArtifact(DependencyQueryBuilder.create(coordinate));
        if (dependency != null) {
            try {
                String name = dependency.getArtifact().getFullyQualifiedName();
                URL url = new URL("file", null, name);
                URLClassLoader loader = new URLClassLoader(new URL[]{url});
                InputStream is = loader.getResourceAsStream("archetype-catalog.xml");
                if (is != null) {
                    cachedArchetypes = new ArchetypeCatalogXpp3Reader().read(is);
                }
            } catch (Exception e) {
                LOG.log(Level.WARNING, "Error while retrieving archetypes due " + e.getMessage(), e);
            }
        }
    }
    return cachedArchetypes;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:30,代码来源:FabricArchetypeCatalogFactory.java

示例7: createCoordinate

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
protected Coordinate createCoordinate(String groupId, String artifactId, String version) {
    CoordinateBuilder builder = CoordinateBuilder.create()
            .setGroupId(groupId)
            .setArtifactId(artifactId);
    if (version != null) {
        builder = builder.setVersion(version);
    }

    return builder;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:11,代码来源:AbstractCamelProjectCommand.java

示例8: getArchetypeCatalog

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public ArchetypeCatalog getArchetypeCatalog() {
    if (cachedArchetypes == null) {
        String version = new VersionHelper().getVersion();

        Coordinate coordinate = CoordinateBuilder.create()
                .setGroupId("io.fabric8.django")
                .setArtifactId("archetypes-catalog")
                .setVersion(version)
                .setPackaging("jar");

        // load the archetype-catalog.xml from inside the JAR
        Dependency dependency = resolver.get().resolveArtifact(DependencyQueryBuilder.create(coordinate));
        if (dependency != null) {
            try {
                String name = dependency.getArtifact().getFullyQualifiedName();
                URL url = new URL("file", null, name);
                URLClassLoader loader = new URLClassLoader(new URL[]{url});
                InputStream is = loader.getResourceAsStream("archetype-catalog.xml");
                if (is != null) {
                    cachedArchetypes = new ArchetypeCatalogXpp3Reader().read(is);
                }
            } catch (Exception e) {
                LOG.log(Level.WARNING, "Error while retrieving archetypes due " + e.getMessage(), e);
            }
        }
    }
    return cachedArchetypes;
}
 
开发者ID:fabric8io,项目名称:django,代码行数:30,代码来源:DjangoArchetypeCatalogFactory.java

示例9: addPlugin

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
protected void addPlugin(String baseCoordinate, String id, String phase, String goal) {
    Coordinate plugInCoordinate = CoordinateBuilder.create(baseCoordinate);
    MavenPluginFacet facet = getFaceted().getFacet(MavenPluginFacet.class);
    MavenPluginBuilder plugin = MavenPluginBuilder.create()
            .setCoordinate(plugInCoordinate);
    ExecutionBuilder execution = ExecutionBuilder.create()
            .addGoal(goal)
            .setId(id)
            .setPhase(phase);
    plugin.addExecution(execution);
    facet.addPlugin(plugin);
}
 
开发者ID:jughyd,项目名称:griffon-forge-addon,代码行数:13,代码来源:AbstractGriffonFacet.java

示例10: getRequiredDependencyOptions

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public Set<Coordinate> getRequiredDependencyOptions() {
    Set<Coordinate> coordinates = new HashSet<Coordinate>();
    if (buildSystemType == BuildSystemType.maven) {
        coordinates.add(CoordinateBuilder.create(BR_COM_INGENIEUX_JBAKE_MAVEN_PLUGIN));
        coordinates.add(CoordinateBuilder.create(ORG_APACHE_MAVEN_PLUGINS_MAVEN_WAR_PLUGIN).setVersion("2.4"));
    }

    return coordinates;
}
 
开发者ID:jbake-org,项目名称:jbake-forge-addon,代码行数:11,代码来源:JBakeFacetImpl_2_0.java

示例11: getCoordinate

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Override
public Coordinate getCoordinate(String checksum)
{
    if (checksum == null)
        return null;

    String coordinate = map.get(checksum);

    if (coordinate == null)
        return null;

    return CoordinateBuilder.create(coordinate);
}
 
开发者ID:windup,项目名称:windup,代码行数:14,代码来源:InMemoryArchiveIdentificationService.java

示例12: isSkipped

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
public static boolean isSkipped(ArchiveCoordinateModel coordinate)
{
    return isSkipped(CoordinateBuilder.create()
                .setArtifactId(coordinate.getArtifactId())
                .setGroupId(coordinate.getGroupId())
                .setClassifier(coordinate.getClassifier())
                .setVersion(coordinate.getVersion()));
}
 
开发者ID:windup,项目名称:windup,代码行数:9,代码来源:SkippedArchives.java

示例13: testJarsAreIdentified

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
/**
 * Run initial Windup rules against the JEE sample app, add a single identification record, and check if the lib is identified.
 */
@Test
public void testJarsAreIdentified() throws Exception
{
    try (GraphContext graphContext = contextFactory.create())
    {
        FileUtils.deleteDirectory(OUTPUT_PATH.toFile());

        InMemoryArchiveIdentificationService inMemoryIdentifier = new InMemoryArchiveIdentificationService();
        inMemoryIdentifier.addMapping("4bf32b10f459a4ecd4df234ae2ccb32b9d9ba9b7", LOG4J_COORDINATE);
        identifier.addIdentifier(inMemoryIdentifier);

        WindupConfiguration wc = new WindupConfiguration();
        wc.setGraphContext(graphContext);
        wc.addInputPath(INPUT_PATH);
        wc.setOutputDirectory(OUTPUT_PATH);
        wc.setOptionValue(OverwriteOption.NAME, true);
        wc.setRuleProviderFilter(new NotPredicate(
                    new RuleProviderPhasePredicate(ArchiveExtractionPhase.class, DecompilationPhase.class, MigrationRulesPhase.class,
                                ReportGenerationPhase.class, ReportRenderingPhase.class)
                    ));

        processor.execute(wc);

        GraphService<IdentifiedArchiveModel> archiveService = new GraphService<>(graphContext, IdentifiedArchiveModel.class);
        Iterable<IdentifiedArchiveModel> archives = archiveService.findAllByProperty(IdentifiedArchiveModel.FILE_NAME, "log4j-1.2.6.jar");
        for (IdentifiedArchiveModel archive : archives)
        {
            ArchiveCoordinateModel archiveCoordinate = archive.getCoordinate();
            Assert.assertNotNull(archiveCoordinate);

            final Coordinate expected = CoordinateBuilder.create(LOG4J_COORDINATE);
            Assert.assertEquals(expected, CoordinateBuilder.create()
                        .setGroupId(archiveCoordinate.getGroupId())
                        .setArtifactId(archiveCoordinate.getArtifactId())
                        .setClassifier(archiveCoordinate.getClassifier())
                        .setVersion(archiveCoordinate.getVersion()));
        }
    }
}
 
开发者ID:windup,项目名称:windup,代码行数:43,代码来源:IdentifyArchivesRulesetTest.java

示例14: testArtifactIdSuffixWithWildcards

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Test
public void testArtifactIdSuffixWithWildcards() throws IOException
{
    // org.jboss.windup.*:*:*
    Assert.assertTrue(SkippedArchives.isSkipped(CoordinateBuilder.create("org.jboss.windup:windup-foo:1.2.3")));
    // org.apache.commons.*:*:*
    Assert.assertTrue(SkippedArchives.isSkipped(CoordinateBuilder.create("org.apache.commons.foo:commons-foo:1.2.3")));
}
 
开发者ID:windup,项目名称:windup,代码行数:9,代码来源:ArchiveCoordinateIdentificationTest.java

示例15: testGroupIdSuffixWithVersionAndClassifierWildcard

import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder; //导入依赖的package包/类
@Test
public void testGroupIdSuffixWithVersionAndClassifierWildcard() throws IOException
{
    // org.jboss.bar:bar-*:*:*
    Assert.assertTrue(SkippedArchives.isSkipped(CoordinateBuilder.create("org.jboss.bar:bar-foo:1.2.3")));
    Assert.assertFalse(SkippedArchives.isSkipped(CoordinateBuilder.create("org.jboss.bar:just-foo:1.2.3")));

}
 
开发者ID:windup,项目名称:windup,代码行数:9,代码来源:ArchiveCoordinateIdentificationTest.java


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