[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-250) Resolve (transitive) dependencies for WAR artifacts

Willem Salembier (JIRA) issues at jboss.org
Tue Jul 19 06:47:00 EDT 2016


     [ https://issues.jboss.org/browse/SHRINKRES-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Salembier updated SHRINKRES-250:
---------------------------------------
    Attachment: ShrinkWrapTest.java


> Resolve (transitive) dependencies for WAR artifacts
> ---------------------------------------------------
>
>                 Key: SHRINKRES-250
>                 URL: https://issues.jboss.org/browse/SHRINKRES-250
>             Project: ShrinkWrap Resolvers
>          Issue Type: Feature Request
>    Affects Versions: 2.2.2
>            Reporter: Willem Salembier
>         Attachments: ShrinkWrapTest.java
>
>
> 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.
> {code}
> 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);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the shrinkwrap-issues mailing list