Willem Salembier created SHRINKRES-250:
------------------------------------------
Summary: 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
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)