4

Maven Wagon HTTP documentation says:

Other features can be configured through system properties:

maven.wagon.http.ssl.insecure = true/false (default false), enable/disable use of relaxed ssl check for user generated certificates.
maven.wagon.http.ssl.allowall = true/false (default false), enable/disable match of the server's X.509 certificate with hostname. If disabled, a browser like check will be used.
maven.wagon.http.ssl.ignore.validity.dates = true/false (default false), ignore issues with certificate dates.
maven.wagon.rto = time in ms (default 1800000), read time out.

Can this configuration also be done in settings.xml?

BVB
  • 5,380
  • 8
  • 41
  • 62
kevin cline
  • 2,608
  • 2
  • 25
  • 38
  • Possible duplicate of [How to tell Maven to disregard SSL errors (and trusting all certs)?](https://stackoverflow.com/questions/21252800/how-to-tell-maven-to-disregard-ssl-errors-and-trusting-all-certs) – Stewart Nov 20 '18 at 21:53
  • 1
    @Stewart Not realy. This question is about configure these settings in `settings.xml` rather `-D...` start parameter. – barthel Nov 20 '18 at 22:52

2 Answers2

4

Since it is reading it from system properties, it needs to be set like this

export MAVEN_OPTS=-Dmaven.wagon.http.ssl.insecure=false -DsomeOtherSystemProperty=value
jmj
  • 237,923
  • 42
  • 401
  • 438
  • I know it's reading from system properties -- I was hoping that I could set the properties in settings.xml. Bleah. Another lose for maven. – kevin cline Jul 02 '15 at 18:46
0

For wagon-2.9: NO

All of them are using the System.getProperty(...) direct and are not configurable in settings.xml.

maven.wagon.rto (see #43 https://github.com/apache/maven-wagon/blob/wagon-2.9/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/HttpMethodConfiguration.java)

maven.wagon.http.ssl.* (see #235ff https://github.com/apache/maven-wagon/blob/wagon-2.9/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java)

barthel
  • 865
  • 9
  • 22
  • 2
    Thanks. It seems like a rather hasty and inconvenient design decision, but maybe there's a good reason beyond my understanding. To me it's yet another bit of configuration in a singularly inconvenient place that's needed to get maven to work. I think system properties are reasonable for stuff that may change from one invocation to the next, e.g. -Dtest=... to run a single test. For this, not so much. It's a problem between the repo and the user and should be configurable in settings.xml – kevin cline Jul 02 '15 at 18:44
  • For future reference, system properties can be set in the pom.xml with the maven-properties plugin. – kutschkem Feb 26 '18 at 14:58