How to tell Maven to disregard SSL errors (and trusting all certs)?

Novice User

I frequently need to run "mvn" command :

mvn -f pom.xml clean install -Dmaven.test.skip=false --settings /Users/myhome/settings.xml -X -Djavax.net.ssl.trustStore=/Users/myhome/truststore.jks -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStorePassword=dummy -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -U

As I need to integrate with various other domains, so currently every time I have to add their certificate to my truststore.jks to prevent SSL handshake errors.

Is there any way I can configure mvn to ignore SSL errors.

rec

You can disable SSL certificate checking by adding one or more of these command line parameters:

  • -Dmaven.wagon.http.ssl.insecure=true - enable use of relaxed SSL check for user generated certificates.
  • -Dmaven.wagon.http.ssl.allowall=true - enable match of the server's X.509 certificate with hostname. If disabled, a browser like check will be used.
  • -Dmaven.wagon.http.ssl.ignore.validity.dates=true - ignore issues with certificate dates.

Official documentation: http://maven.apache.org/wagon/wagon-providers/wagon-http/

Here's the oneliner for an easy copy-and-paste:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

Ajay Gautam suggested that you could also add the above to the ~/.mavenrc file as not to have to specify it every time at command line:

$ cat ~/.mavenrc 
MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

How can I tell Spotlight to index my .dSYM bundles?

来自分类Dev

PHP https check with flexible ssl (cloudflare), how to do?

来自分类Dev

How to tell Visual Studio to use a different source code directory to debug into a library?

来自分类Dev

在代理后使用Maven和SSL的问题

来自分类Dev

How to tell if a cell value has passed validation

来自分类Dev

How to call a function or tell if a MKPointAnnotation is clicked on a MKMapView SwiftUI

来自分类Dev

How to set an environment variable in maven depending on the OS

来自分类Dev

How can I get a list of PHP errors occurred in a page?

来自分类Dev

How to add profiles to default maven goals in Eclipse?

来自分类Dev

ReactiveCocoa catch all the errors - async network operation on collection object

来自分类Dev

How do I tell if an XMLHttpRequest failed due to a network issue?

来自分类Dev

Catching all errors

来自分类Dev

如果我已经添加了maven依赖项,那么我缺少什么能够导入io.netty.handler.ssl.util。*?

来自分类Dev

How to generate a resource to be included in Jar file with maven?

来自分类Dev

How can I tell if an UUID generated by QUuid::createUuid() is based on entrophy of cryptographic quality?

来自分类Dev

How to hide cat errors?

来自分类Dev

How to tell the precedence of operators in a context free grammar

来自分类Dev

How can i stamp strings in c without errors?

来自分类Dev

How to restrict website for SSL only on production but keep working without ssl locally

来自分类Dev

How to deploy SpringBoot Maven application with Jenkins ?

来自分类Dev

In F#, how do I tell if an object is an Async<_>, and how can I cast it to an Async<_>?

来自分类Dev

How to properly use monadic expressions in Haskell without getting parse errors?

来自分类Dev

下载项目依赖项时,Maven抛出IllegalStateException(与SSL相关?)

来自分类Dev

Intellij Maven存储库自签名证书,ssl错误

来自分类Dev

How to check for errors in RAM via linux?

来自分类Dev

如何定义Maven pom.xml以使用org.eclipse.jetty.server.ssl.SslSocketConnector

来自分类Dev

OpenSSL for making iOS certs on a windows machine - do I need a server?

来自分类Dev

找不到/etc/pki/tls/certs/ca-bundle.crt

来自分类Dev

/etc/ssl/certs/ca-certificates.crt的权限问题

Related 相关文章

  1. 1

    How can I tell Spotlight to index my .dSYM bundles?

  2. 2

    PHP https check with flexible ssl (cloudflare), how to do?

  3. 3

    How to tell Visual Studio to use a different source code directory to debug into a library?

  4. 4

    在代理后使用Maven和SSL的问题

  5. 5

    How to tell if a cell value has passed validation

  6. 6

    How to call a function or tell if a MKPointAnnotation is clicked on a MKMapView SwiftUI

  7. 7

    How to set an environment variable in maven depending on the OS

  8. 8

    How can I get a list of PHP errors occurred in a page?

  9. 9

    How to add profiles to default maven goals in Eclipse?

  10. 10

    ReactiveCocoa catch all the errors - async network operation on collection object

  11. 11

    How do I tell if an XMLHttpRequest failed due to a network issue?

  12. 12

    Catching all errors

  13. 13

    如果我已经添加了maven依赖项,那么我缺少什么能够导入io.netty.handler.ssl.util。*?

  14. 14

    How to generate a resource to be included in Jar file with maven?

  15. 15

    How can I tell if an UUID generated by QUuid::createUuid() is based on entrophy of cryptographic quality?

  16. 16

    How to hide cat errors?

  17. 17

    How to tell the precedence of operators in a context free grammar

  18. 18

    How can i stamp strings in c without errors?

  19. 19

    How to restrict website for SSL only on production but keep working without ssl locally

  20. 20

    How to deploy SpringBoot Maven application with Jenkins ?

  21. 21

    In F#, how do I tell if an object is an Async<_>, and how can I cast it to an Async<_>?

  22. 22

    How to properly use monadic expressions in Haskell without getting parse errors?

  23. 23

    下载项目依赖项时,Maven抛出IllegalStateException(与SSL相关?)

  24. 24

    Intellij Maven存储库自签名证书,ssl错误

  25. 25

    How to check for errors in RAM via linux?

  26. 26

    如何定义Maven pom.xml以使用org.eclipse.jetty.server.ssl.SslSocketConnector

  27. 27

    OpenSSL for making iOS certs on a windows machine - do I need a server?

  28. 28

    找不到/etc/pki/tls/certs/ca-bundle.crt

  29. 29

    /etc/ssl/certs/ca-certificates.crt的权限问题

热门标签

归档