0 Replies Latest reply on Feb 26, 2017 10:52 AM by Falko Modler

    ShrinkWrap Resolvers: Alternate way to determine current settings.xml

    Falko Modler Newbie

      Hello everybody!

       

      Just a quick heads-up for those trying to load the settings.xml that has been defined by mvn -s ... in a maven surefire process (= a forked test).

       

      You can just use ${session.request.userSettingsFile.path} and pass that to surefire plugin:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <org.apache.maven.user-settings>${session.request.userSettingsFile.path}</org.apache.maven.user-settings>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      

       

      After searching the web for an easy solution without success, I found this property by playing around with mvn help:evaluate -Dexpression=session.

      I have tested this with Maven 3.2.5 and 3.3.9, with and without -s ....

       

      Hope this helps.