In short: you can't. At least not easily. maven.test.skip
does not prevent the surefire:test mojo from running, it only configures the plugin to do nothing. (same for compile:testcompile).
Both mojos need dependency resolving of scope test (part of the mojo definition).
So, the only options of preventing those dependencies from being resolved would be either:
- Use a profile and rebind compiler:testCompile as well as surefire:test to non existing phases
- put all your test dependencies in a separate profile
However, both options are rather dirty.
So your best bet would be to install your dependent artifacts first (using mvn install
) and simply accept the way maven resolves dependencies.