Package org.eclipse.aether.artifact

Examples of org.eclipse.aether.artifact.DefaultArtifact


   {
      RepositorySystem system = container.getRepositorySystem();
      Settings settings = container.getSettings();
      DefaultRepositorySystemSession session = container.setupRepoSession(system, settings);
      final String mavenCoords = toMavenCoords(addonId);
      Artifact queryArtifact = new DefaultArtifact(mavenCoords);
      session.setDependencyTraverser(new AddonDependencyTraverser(classifier));
      session.setDependencySelector(new AddonDependencySelector(classifier));
      Dependency dependency = new Dependency(queryArtifact, null);

      List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);
View Full Code Here


         RepositorySystem system = container.getRepositorySystem();
         Settings settings = container.getSettings();
         DefaultRepositorySystemSession session = container.setupRepoSession(system, settings);

         Artifact artifact = new DefaultArtifact(toMavenCoords(AddonId.from(addonName, version)));

         List<RemoteRepository> repositories = MavenRepositories.getRemoteRepositories(container, settings);

         VersionRangeRequest rangeRequest = new VersionRangeRequest(artifact, repositories, null);
View Full Code Here

   private DependencyNode traverseAddonGraph(String coords, RepositorySystem system, Settings settings,
            DefaultRepositorySystemSession session)
   {
      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;
View Full Code Here

         if (version == null || version.isEmpty())
         {
            version = pom.getTextValueForPatternName("parent/version");
         }

         final Artifact foundArtifact = new DefaultArtifact(groupId, artifactId, type, version);
         foundArtifact.setFile(pomFile);
         return foundArtifact;
      }
      catch (final Exception e)
      {
         throw new RuntimeException("Could not parse pom.xml: " + pomFile, e);
View Full Code Here

            throw new IllegalArgumentException("Illegal dependency coordinates: " + coordsString0);
        final String groupId = coords[0];
        final String artifactId = coords[1];
        final String version = coords[2];
        final String classifier = coords.length > 3 ? coords[3] : null;
        return new DefaultArtifact(groupId, artifactId, classifier, "jar", version);
    }
View Full Code Here

        final String artifactId = m.group("artifactId");
        String version = m.group("version");
        if (version == null || version.isEmpty())
            version = "[0,)";
        final String classifier = m.group("classifier");
        return new DefaultArtifact(groupId, artifactId, classifier, type, version);
    }
View Full Code Here

   * @return filtered value
   */
  public String filter(final Map<String, String> context, final String value) {
    String filtered = checkNotNull(value);
    try {
      final DefaultArtifact artifact = new DefaultArtifact(value + ":${project.dm.version}");
      if ("${project.dm.version}".equals(artifact.getVersion())
          && CLASSIFIER.matcher(artifact.getClassifier()).matches()) {
        filtered = value + ":${project.dm.version}";
      }
    }
    catch (IllegalArgumentException ignore) {
      // do nothing
View Full Code Here

  @Override
  Map<String, String> mappings(final Map<String, String> context, final String value, final Model model) {
    final Map<String, String> mappings = Maps.newHashMap();

    if (value.contains("${project.dm.") && model.getDependencyManagement() != null) {
      final DefaultArtifact artifact;
      try {
        artifact = new DefaultArtifact(value);

        final List<Dependency> dependencies = model.getDependencyManagement().getDependencies();

        for (Dependency dependency : dependencies) {
          if (!dependency.getGroupId().equalsIgnoreCase(artifact.getGroupId())) {
            continue;
          }
          if (!dependency.getArtifactId().equalsIgnoreCase(artifact.getArtifactId())) {
            continue;
          }
          String extensionToCompare = dependency.getType();
          if (extensionToCompare == null || extensionToCompare.isEmpty()) {
            extensionToCompare = "jar";
          }
          if (!extensionToCompare.equals(artifact.getExtension())) {
            continue;
          }
          String classifierToCompare = dependency.getClassifier();
          if (classifierToCompare == null || extensionToCompare.isEmpty()) {
            classifierToCompare = "";
          }
          if (!classifierToCompare.equals(artifact.getClassifier())) {
            continue;
          }

          mappings.put("project.dm.version", dependency.getVersion());
        }
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

            throw new IllegalArgumentException("Illegal dependency coordinates: " + coordsString0);
        final String groupId = coords[0];
        final String artifactId = coords[1];
        final String version = coords[2];
        final String classifier = coords.length > 3 ? coords[3] : null;
        return new DefaultArtifact(groupId, artifactId, classifier, type, version);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.aether.artifact.DefaultArtifact

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.