Package org.eclipse.aether.graph

Examples of org.eclipse.aether.graph.Dependency


            return "Dependencies for " + appId;
       
        StringBuilder buffer = new StringBuilder(128);
        buffer.append(toString(a));
       
        Dependency d = node.getDependency();
//        if (d != null && d.getScope().length() > 0) {
//            buffer.append(" [").append(d.getScope());
//            if (d.isOptional())
//                buffer.append(", optional");
//            buffer.append("]");
//        }
        {
            String premanaged = DependencyManagerUtils.getPremanagedVersion(node);
            if (premanaged != null && !premanaged.equals(a.getBaseVersion()))
                buffer.append(" (version managed from ").append(premanaged).append(")");
        }
        {
            String premanaged = DependencyManagerUtils.getPremanagedScope(node);
            if (premanaged != null && !premanaged.equals(d.getScope()))
                buffer.append(" (scope managed from ").append(premanaged).append(")");
        }
        DependencyNode winner = (DependencyNode) node.getData().get(ConflictResolver.NODE_DATA_WINNER);
        if (winner != null && !ArtifactIdUtils.equalsId(a, winner.getArtifact())) {
            Artifact w = winner.getArtifact();
View Full Code Here


    private static RemoteRepository newCentralRepository(RepositoryPolicy policy) {
        return new RemoteRepository.Builder("central", "default", "http://central.maven.org/maven2/").setPolicy(policy).build();
    }

    private static Dependency toDependency(String coords) {
        return new Dependency(coordsToArtifact(coords), JavaScopes.RUNTIME, false, getExclusions(coords));
    }
View Full Code Here

        return new RemoteRepository.Builder(name, "default", url).setPolicy(policy).build();
    }

    // visible for testing
    static Dependency toDependency(String coords, String type) {
        return new Dependency(coordsToArtifact(coords, type), JavaScopes.RUNTIME, false, getExclusions(coords));
    }
View Full Code Here

    static Dependency toDependency(String coords, String type) {
        return new Dependency(coordsToArtifact(coords, type), JavaScopes.RUNTIME, false, getExclusions(coords));
    }

    private static Dependency toDependency(Artifact artifact) {
        return new Dependency(artifact, JavaScopes.RUNTIME, false, null);
    }
View Full Code Here

   *
   * @param gav   GAV to make Dependency, may not be {@code null}.
   * @param scope the needed scope, or {@code null}
   */
  public static Dependency createDependencyFromGav(final Gav gav, final String scope) {
    Dependency dependency =
        new Dependency(new DefaultArtifact(gav.getGroupId(), gav.getArtifactId(), gav.getExtension(),
            gav.getVersion()), scope);

    return dependency;
  }
View Full Code Here

  @Test
  public void testDependency() {
    Gav gav = new Gav("org.apache.maven", "apache-maven", "3.0-beta-1");

    Dependency dep = Utils.createDependencyFromGav(gav, "compile");

    Assert.assertEquals(dep.getArtifact().getGroupId(), gav.getGroupId());
    Assert.assertEquals(dep.getArtifact().getArtifactId(), gav.getArtifactId());
    Assert.assertEquals(dep.getArtifact().getVersion(), gav.getVersion());
    Assert.assertEquals("compile", dep.getScope());
  }
View Full Code Here

    private static RemoteRepository newRemoteRepository(String name, String url, RepositoryPolicy policy) {
        return new RemoteRepository.Builder(name, "default", url).setPolicy(policy).build();
    }

    private static Dependency toDependency(String coords, String type) {
        return new Dependency(coordsToArtifact(coords, type), JavaScopes.RUNTIME, false, getExclusions(coords));
    }
View Full Code Here

    private static Dependency toDependency(String coords, String type) {
        return new Dependency(coordsToArtifact(coords, type), JavaScopes.RUNTIME, false, getExclusions(coords));
    }

    private static Dependency toDependency(Artifact artifact) {
        return new Dependency(artifact, JavaScopes.RUNTIME, false, null);
    }
View Full Code Here

            return null;

        final StringBuilder buffer = new StringBuilder(128);
        buffer.append(toString(a));

        final Dependency d = node.getDependency();

//        if (d != null && d.getScope().length() > 0) {
//            buffer.append(" [").append(d.getScope());
//            if (d.isOptional())
//                buffer.append(", optional");
//            buffer.append("]");
//        }
        final String premanagedVersion = DependencyManagerUtils.getPremanagedVersion(node);
        if (premanagedVersion != null && !premanagedVersion.equals(a.getBaseVersion()))
            buffer.append(" (version managed from ").append(premanagedVersion).append(")");

        final String premanagedScope = DependencyManagerUtils.getPremanagedScope(node);
        if (premanagedScope != null && !premanagedScope.equals(d.getScope()))
            buffer.append(" (scope managed from ").append(premanagedScope).append(")");

        final DependencyNode winner = (DependencyNode) node.getData().get(ConflictResolver.NODE_DATA_WINNER);
        if (winner != null && !ArtifactIdUtils.equalsId(a, winner.getArtifact())) {
            Artifact w = winner.getArtifact();
View Full Code Here

      session.setDependencyTraverser(new AddonDependencyTraverser(this.classifier));
      session.setDependencySelector(new AddonDependencySelector(this.classifier));
      Artifact queryArtifact = new DefaultArtifact(coords);

      List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);
      CollectRequest collectRequest = new CollectRequest(new Dependency(queryArtifact, null), repositories);

      CollectResult result;
      try
      {
         result = system.collectDependencies(session, collectRequest);
View Full Code Here

TOP

Related Classes of org.eclipse.aether.graph.Dependency

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.