Resolution Dependent War File with Resolution

I am working on setting up Arkillian testing. I want to deploy a WAR for 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 change 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 is not coping with military files. I experimented with org.jboss.shrinkwrap.resolver.api.ResolveWithRangeSupportStage.resolveVersionRange (String) as well, and it seems to interpret ": war" in coordinates as a version that obviously won't work.

If I put the version, it works:

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

But I need to get it to work without a version, because this will change by the time, and I don’t want to adapt the version for each version.

Any ideas?

+6
source share
1 answer

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

+4
source

Source: https://habr.com/ru/post/974027/


All Articles