Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-250

Resolve (transitive) dependencies for WAR artifacts

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Major
    • None
    • 2.2.2
    • None
    • None

    Description

      Is there a way to resolve the (transitive) dependencies of a WAR artifacts, using the default resolve method? The behavior seems different in comparison to JAR artifacts. Is this intentional?

      It does work if you start a resolver from a pom file.

      System.out.println("JAR dependencies via resolve");
      MavenResolvedArtifact[] artifacts = Maven.resolver().resolve("io.fabric8:fabric8-cxf:jar:2.2.0").withTransitivity().asResolvedArtifact();
      for (MavenResolvedArtifact artifact : artifacts) {
          System.out.println(artifact);
      }
      
      System.out.println("No WAR dependencies via resolve");
      artifacts = Maven.resolver().resolve("io.fabric8.jube:war:war:2.2.0").withTransitivity().asResolvedArtifact();
      for (MavenResolvedArtifact artifact : artifacts) {
          System.out.println(artifact);
      }
      
      System.out.println("All WAR dependencies via pom file");
      artifacts = Maven.resolver().loadPomFromFile(artifacts[0].asFile().getAbsolutePath().replace(".war", ".pom")).importRuntimeDependencies().resolve().withTransitivity().asResolvedArtifact();
      for (MavenResolvedArtifact artifact : artifacts) {
          System.out.println(artifact);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            willem.salembier@gmail.com Willem Salembier (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: