If you are using Shrinkwrap Maven Resolver, you can try to do following:
and then add this as a library to your final deployment (or merge with your archive) . I used war classifier in my project and that worked well. Maybe classes are supported too.
Thanks for your answer.
I tried but it's trying to get the dependency from Nexus.
myproject/classes/myartifactId-classes.pom from https://host.net:11000/nexus/content/groups/my_repositories/. Reason:
org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact myproject:myartifact:pom:classes in proj-nexus (https://host.net:11000/nexus/content/groups/my_repositories
The thing is that the dependency I'm trying to add is a module. Basically my project is set in the following way:
myprojectPom (packaging POM) has two modules: module1 (WAR) and module2 (WAR). The module2 is the one I'm working on and basically it's a project that tests module1 only so I need dependency from the module1.
Does it make sense?
if you run the tests from the command line, then you need to have the project mygroupId:myartifactId "installed" in your local Maven repository. If you run the the test from IDE the presence of the artifact in the local repo is not necessary.
When you resolve artifacts with classifier, such as tests, you need to include all G:A:P:C:V parts of coordinates string:
Regarding the version - you don't have to specify it there if you have the corresponding dependency in the "pom.xml" file you are loading. Otherwise it's necessary.
Hope it makes sense.
It wasn't mentioned here - if you want to put the resolved artifact into your deployment, then just call on your archive: