Maybe the answer is that I need to stop using the maven-war-plugin overlay behaviour, and change the overlay project to be a Servlet 3.0 web-fragment instead (so all the 'overlaying' actually happens in-container at runtime). I'll give that a try...
MavenImporter does not support currently WAR overlays, I've filled https://issues.jboss.org/browse/SHRINKRES-111 to track the issue.
The workaround is either:
- Move tests to integration-test phase and use ZipImporter to import resulting WAR from target folder
- Build war by yourself using low leve ShrinkWrap API + ShrinkWrap Maven Resolver to get required libraries
The first way breaks IDE support, the latter is more work and might get broken if you change the layout of your example.
In the end I did change the 'overlay' war project to be a Servlet 3.0 web-fragment (jar) project instead, to avoid using the overlay feature of maven-war-plugin completely, and that works fine for us. Plus our builds go faster.