0 Replies Latest reply on Oct 31, 2017 3:47 PM by Daniel Platz

    gradle shrinkwrap resolver: how to fetch single artifact?

    Daniel Platz Newbie

      hi,

      with shrinkwraps's maven resolver it is easily possible to get hold of maven artifacts:

       

      Maven.resolver().resolve("G:A:V").withTransitivity().as(File.class);

       

      This is sometimes nice if I want to explore an api/lib with arquillian. I add the whole jar to my deployment an write tests to explore the api.

       

      with gradle now, i would like to do the same but it seems the incubating gradle resolver does not offer much in this regard yet. is it planned to support the above also for gradle.

       

      (i know, there is support for importing e.g. all compile dependencies; but i would like to have it as fine-grain as with maven)

       

      final List<? extends Archive> archives = Gradle.resolver()

                    .forProjectDirectory(".")

                    .importCompileAndRuntime()

                    .resolve()

                    .asList(JavaArchive.class);

       

      if someone can point me in the right direct and might say if this is maybe not possible with the gradle tooling, that would be great.

       

      (just for information in your are wondering why i dont want to use the maven-ŕesolver? well, in corporate environments, where you e.g. have to set up access tokesn for repo-access, it just removes the need to configure gradle AND maven to be able to access the repo. also, it would not be download by two different tools. it is no big issue, but would be nice to not needing to rely on maven...)

       

      thanks,

      daniel