コード例 #1
0
  @Override
  void installErraiFacetSpecifics() {
    String erraiVersion = Versions.getInstance().getErrai_version();
    List<? extends Dependency> dependencies =
        Arrays.asList(
            DependencyBuilder.create("org.jboss.errai:errai-common:" + erraiVersion),
            DependencyBuilder.create("org.jboss.errai:errai-jaxrs-client:" + erraiVersion)
                .setScopeType("provided"),
            DependencyBuilder.create("org.jboss.errai:errai-jaxrs-provider:" + erraiVersion),
            DependencyBuilder.create("javax.enterprise:cdi-api:1.0-SP4"),
            DependencyBuilder.create("org.jboss.resteasy:resteasy-jaxrs:2.2.3.GA"));

    DependencyFacet deps = project.getFacet(DependencyFacet.class);
    for (Dependency dependency : dependencies) {
      deps.addDirectDependency(dependency);
    }
  }
コード例 #2
0
ファイル: ForgeAPIFacet.java プロジェクト: ryanbradley/core
  @Override
  public boolean install() {
    DependencyFacet deps = project.getFacet(DependencyFacet.class);

    List<Dependency> versions =
        deps.resolveAvailableVersions("org.jboss.forge:forge-shell-api:[,]");
    Dependency version =
        shell.promptChoiceTyped("Install which version of the Forge API?", versions);
    deps.setProperty("forge.api.version", version.getVersion());
    DependencyBuilder apiDep =
        DependencyBuilder.create("org.jboss.forge:forge-shell-api:${forge.api.version}")
            .setScopeType(ScopeType.PROVIDED);
    DependencyBuilder testDep =
        DependencyBuilder.create("org.jboss.forge:forge-test-harness:${forge.api.version}")
            .setScopeType(ScopeType.TEST);
    DependencyBuilder testShellDep =
        DependencyBuilder.create("org.jboss.forge:forge-shell:${forge.api.version}")
            .setScopeType(ScopeType.TEST);

    installer.install(project, apiDep);
    installer.install(project, testDep);
    installer.install(project, testShellDep);
    return true;
  }