unfortunately you can't use the same settings as the running Maven, because of surefire not passing that information. See http://jira.codehaus.org/browse/SUREFIRE-790.
However, SWR has a workaround, you're able to set settings.xml via a system property, which is less convenient but will allow developer to change the path without touching tests.
You can set both path to settings.xml and path to local repository via following system properties:
Please note that you have to get them propagated to Surefire configuration, e.g.
<version>2.9</version><!-- or upper -->
Then you can do:
mvn -s settings.xml -Dorg.apache.maven.user-settings=settings.xml clean package
and both your test and the running maven will use the same settings.xml file.
By the way, I'm just curious, what version of ShrinkWrap Maven Resolver are you using?
Just a note, SWR means ShrinkWrap Maven Resolver, it's just much shorter to write
OK, thanks. I was under the impression that this wouldn't be possible, but kept searching nonetheless.
I once tried setting org.apache.maven.user-settings, but it didn' t work because hadn't done the surefire configuration stuff. I'll try that now.
The SWR version I used were first the default one imported along with arquillian (1.0.0-alpha12 I believe), but that wasn't very convenient, so I bumped it to 1.0.0-beta? to finally go straight to 1.1.0-alpha-1.
The last version bump was because I wanted to try the Maven.dependency(...) syntax, but as far as I know, this doesn't allow to do useCentralRepo=false.
Ah sorry, Karel, you would be aware of it