• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Coordinate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: execute

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
@Override
public Result execute(final UIExecutionContext context) throws Exception
{
   final UIContext uiContext = context.getUIContext();
   applyUIValues(uiContext);

   // add driver dependency
   final Project project = helper.getProject(uiContext);
   final DatabaseType database = dbType.getValue();
   final Coordinate driverCoordinate = database.getDriverCoordinate();
   SpringBootHelper.addDependency(project, driverCoordinate.getGroupId(), driverCoordinate.getArtifactId())
            .setScopeType("runtime");
   SpringBootHelper.addSpringBootDependency(project, SpringBootFacet.SPRING_BOOT_STARTER_DATA_JPA_ARTIFACT)
            .setScopeType("runtime");

   return Results.success("Spring Boot JPA successfully set up!");
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:18,代码来源:SpringBootJPASetupWizard.java


示例2: findPlugin

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
public static MavenPlugin findPlugin(Project project, String groupId, String artifactId) {
    if (project != null) {
        MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
        if (pluginFacet != null) {
            List<MavenPlugin> plugins = pluginFacet.listConfiguredPlugins();
            if (plugins != null) {
                for (MavenPlugin plugin : plugins) {
                    Coordinate coordinate = plugin.getCoordinate();
                    if (coordinate != null) {
                        if (Objects.equal(groupId, coordinate.getGroupId()) &&
                                Objects.equal(artifactId, coordinate.getArtifactId())) {
                            return plugin;
                        }
                    }
                }
            }
        }
    }
    return null;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:21,代码来源:MavenHelpers.java


示例3: addDependency

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
protected void addDependency(String baseCoordinate, String majorVersion) {
    DependencyQuery query = DependencyQueryBuilder
            .create(baseCoordinate)
            .setFilter(new NonSnapshotDependencyFilter())
            .setRepositories(dependencyRepository);
    List<Coordinate> coordinates = dependencyResolver.resolveVersions(query);

    int i = 0;
    for (Coordinate coordinate : coordinates) {
        if (coordinate.getVersion().startsWith(majorVersion))
            break;
        i++;
    }

    int v = i;
    for (; v < coordinates.size(); v++) {
        if (!coordinates.get(v).getVersion().startsWith(majorVersion))
            break;
    }

    v--;

    builder.setCoordinate(coordinates.get(v));

    installer.install(getFaceted(), builder);
}
 
开发者ID:jughyd,项目名称:griffon-forge-addon,代码行数:27,代码来源:AbstractGriffonFacet.java


示例4: isDependencyRequirementsMet

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
@Override
public boolean isDependencyRequirementsMet() {
    boolean isInstalled = false;
    MavenPluginFacet mavenPluginFacet = origin
            .getFacet(MavenPluginFacet.class);
    // create an iterator
    Set<Coordinate> requiredCoordinates = getRequiredDependencyOptions();
    Iterator iterator = requiredCoordinates.iterator();
    while (iterator.hasNext()) {
        Coordinate coordinate = (Coordinate) iterator.next();
        if (mavenPluginFacet.hasEffectivePlugin(coordinate)) {
            isInstalled = true;

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


示例5: installMavenPluginDependencies

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例6: addMappingsFrom

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
public InMemoryArchiveIdentificationService addMappingsFrom(File file)
{
    try (FileInputStream inputStream = new FileInputStream(file))
    {
        LineIterator iterator = IOUtils.lineIterator(inputStream, "UTF-8");
        int lineNumber = 0;
        while (iterator.hasNext())
        {
            lineNumber++;
            String line = iterator.next();
            if (line.startsWith("#") || line.trim().isEmpty())
                continue;
            String[] parts = StringUtils.split(line, ' ');
            if (parts.length < 2)
                throw new IllegalArgumentException("Expected 'SHA1 GROUP_ID:ARTIFACT_ID:[PACKAGING:[COORDINATE:]]VERSION', but was: [" + line
                            + "] in [" + file + "] at line [" + lineNumber + "]");

            addMapping(parts[0], parts[1]);
        }
    }
    catch (IOException e)
    {
        throw new WindupException("Failed to load SHA1 to " + Coordinate.class.getSimpleName() + " definitions from [" + file + "]", e);
    }
    return this;
}
 
开发者ID:windup,项目名称:windup,代码行数:27,代码来源:InMemoryArchiveIdentificationService.java


示例7: getCoordinate

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例8: isSkipped

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
public static boolean isSkipped(Coordinate coordinate)
{
    for (Entry<Coordinate, VersionRange> entry : map.entrySet())
    {
        Coordinate pattern = entry.getKey();
        VersionRange range = entry.getValue();

        if (isPatternMatch(pattern.getGroupId(), coordinate.getGroupId())
                    && isPatternMatch(pattern.getArtifactId(), coordinate.getArtifactId())
                    && isPatternMatch(pattern.getClassifier(), coordinate.getClassifier()))
        {
            if (range.isEmpty() || range.includes(new SingleVersion(coordinate.getVersion())))
                return true;
        }
    }
    return false;
}
 
开发者ID:windup,项目名称:windup,代码行数:18,代码来源:SkippedArchives.java


示例9: replaceRulesetsDirectoryWithLatestReleaseIfAny

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
public String replaceRulesetsDirectoryWithLatestReleaseIfAny() throws IOException, DependencyException
{
    if (!this.rulesetsNeedUpdate(false))
        return null;

    Path windupRulesDir = getRulesetsDir();
    Path coreRulesetsDir = windupRulesDir.resolve(RULESET_CORE_DIRECTORY);

    Coordinate rulesetsCoord = getLatestReleaseOf(RULES_GROUP_ID, RULESETS_ARTIFACT_ID);
    if(rulesetsCoord == null)
        throw new WindupException("No Windup rulesets release found.");

    FileUtils.deleteDirectory(coreRulesetsDir.toFile());
    extractArtifact(rulesetsCoord, coreRulesetsDir.toFile());

    return rulesetsCoord.getVersion();
}
 
开发者ID:windup,项目名称:windup,代码行数:18,代码来源:RulesetsUpdater.java


示例10: getLatestReleaseOf

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例11: execute

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
    if (!context.getPrompt().promptBoolean(
        "Are you sure you want to continue? This command will delete current directories: addons, bin, lib, rules/migration-core"))
    {
        return Results.fail("Updating distribution was aborted.");
    }

    // Find the latest version.
    Coordinate latestDist = this.updater.getLatestReleaseOf("org.jboss.windup", "windup-distribution");
    Version latestVersion = SingleVersion.valueOf(latestDist.getVersion());
    Version installedVersion = currentAddon.getId().getVersion();
    if (latestVersion.compareTo(installedVersion) <= 0)
    {
        return Results.fail(Util.WINDUP_BRAND_NAME_ACRONYM+" CLI is already in the most updated version.");
    }

    distUpdater.replaceWindupDirectoryWithDistribution(latestDist);

    return Results.success("Sucessfully updated "+Util.WINDUP_BRAND_NAME_ACRONYM+" CLI to version " + latestDist.getVersion() + ". Please restart RHAMT CLI.");
}
 
开发者ID:windup,项目名称:windup,代码行数:23,代码来源:WindupUpdateDistributionCommand.java


示例12: createCoordinate

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例13: createCoordinate

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例14: getArchetypeCatalog

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例15: createCoordinate

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例16: addMavenCompilerPlugin

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
private void addMavenCompilerPlugin() {
    Coordinate coordinate = ForgeUtils.coordinate("org.apache.maven.plugins", "maven-compiler-plugin");
    MavenPlugin plugin = ForgeUtils.findDirectPlugin(getFaceted(), coordinate.getArtifactId());

    MavenPluginBuilder builder;
    ConfigurationBuilder configurationBuilder;
    if (plugin != null) {
        builder = MavenPluginBuilder.create(plugin);
        configurationBuilder = ConfigurationBuilder.create(plugin.getConfig(), builder);
    } else {
        builder = MavenPluginBuilder.create().setCoordinate(coordinate);
        configurationBuilder = ConfigurationBuilder.create();
    }
    builder.setConfiguration(configurationBuilder);


    if (plugin != null) {
        // Update it.
        report("maven-compiler-plugin already configured in the `pom.xml`, updating configuration...");
        // Removing existing configuration.
        configurationBuilder.removeConfigurationElement("source");
        configurationBuilder.removeConfigurationElement("target");
        // Set the version
        configurationBuilder.createConfigurationElement("source").setText("1.8");
        configurationBuilder.createConfigurationElement("target").setText("1.8");
        getFaceted().getFacet(MavenPluginFacet.class).updatePlugin(builder);
    } else {
        configurationBuilder.createConfigurationElement("source").setText("1.8");
        configurationBuilder.createConfigurationElement("target").setText("1.8");
        getFaceted().getFacet(MavenPluginFacet.class).addPlugin(builder);
    }

    // Remove properties is there
    MavenFacet maven = getMavenFacet();
    Model pom = maven.getModel();
    Properties properties = pom.getProperties();
    properties.remove("maven.compiler.source");
    properties.remove("maven.compiler.target");
    maven.setModel(pom);
}
 
开发者ID:cescoffier,项目名称:vertx-forge-addon,代码行数:41,代码来源:VertxMavenFacet.java


示例17: getArchetypeCatalog

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例18: addPlugin

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例19: getRequiredDependencyOptions

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的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


示例20: getCoordinate

import org.jboss.forge.addon.dependencies.Coordinate; //导入依赖的package包/类
@Override
public Coordinate getCoordinate(String checksum)
{
    for (ArchiveIdentificationService identifier : identifiers)
    {
        Coordinate coordinate = identifier.getCoordinate(checksum);
        if (coordinate != null)
            return coordinate;
    }
    return null;
}
 
开发者ID:windup,项目名称:windup,代码行数:12,代码来源:CompositeArchiveIdentificationService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XSAnnotation类代码示例发布时间:2022-05-23
下一篇:
Java GraphSelectionEvent类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap