-
1. Re: Using current maven settings.xml
kpiwko Nov 16, 2011 1:44 AM (in response to mleduque)Hi Mickael,
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:
org.apache.maven.user-settings
maven.repo.local
See
Please note that you have to get them propagated to Surefire configuration, e.g.
<properties>
<org.apache.maven.user-settings>default/value</org.apache.maven.user-settings>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version><!-- or upper -->
<configuration>
<systemPropertyVariables>
<org.apache.maven.user-settings>${org.apache.maven.user-settings}</org.apache.maven.user-settings>
</systemPropertyVariables>
</configuration>
</plugin>
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?
Karel
-
2. Re: Using current maven settings.xml
kpiwko Nov 16, 2011 1:47 AM (in response to kpiwko)Just a note, SWR means ShrinkWrap Maven Resolver, it's just much shorter to write
-
3. Re: Using current maven settings.xml
mleduque Nov 16, 2011 2:48 AM (in response to kpiwko)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.
-
4. Re: Using current maven settings.xml
mleduque Nov 28, 2011 3:52 AM (in response to mleduque)Someone seems to expect the same thing as me :
http://jira.codehaus.org/browse/SUREFIRE-790
Though given the comments I have few hopes.
-
5. Re: Using current maven settings.xml
mleduque Nov 28, 2011 4:21 AM (in response to mleduque)Ah sorry, Karel, you would be aware of it