Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving depending war file with shrinkwrap maven resolver

I'm working on setup of arquillian testing. I want to deploy a WAR to JBoss using arquillian. This war is defined as a dependency in my pom.xml:

    <dependency>
        <groupId>my.project</groupId>
        <artifactId>mywar</artifactId>
        <version>1.0</version>
        <type>war</type>
        <scope>runtime</scope>
    </dependency>   

But when I try to resove this dependency using shrinkwrap, it throws a NoResolvedResultException:

PomEquippedResolveStage resolver = Maven.configureResolver().workOffline().loadPomFromFile("pom.xml");  
File war = resolver.resolve("my.project:mywar:war").withoutTransitivity().asSingleFile();

It seems that somehow the resolver isn't able to deal with war files. I experminted with org.jboss.shrinkwrap.resolver.api.ResolveWithRangeSupportStage.resolveVersionRange(String) as well and it seems to interpret the ":war" in the coordinates as the version - which obviously won't work.

If I supply the version, it works:

Maven.resolver().resolve("my.project:mywar:war:1.0").withoutTransitivity().asSingleFile();

But I need to make it work without the version because this will change by the time and I don't want to adapt the version on each release.

Any ideas?

like image 730
roehrijn Avatar asked Aug 19 '14 12:08

roehrijn


1 Answers

Since your artifact is not JAR, I think you have to add a question mark. Your resolver should look like: .resolve("my.project:mywar:war:?")

like image 155
Apostolos Emmanouilidis Avatar answered Jan 02 '23 20:01

Apostolos Emmanouilidis