Maven dependencies are failing with a 501 error

前端 未结 25 3562
南旧
南旧 2020-11-22 06:28

Recently Maven build jobs running in Jenkins are failing with the below exception saying that they couldn\'t pull dependencies from Maven Central

25条回答
  •  遥遥无期
    2020-11-22 07:26

    Using Ubuntu 16.04, java 1.8.0_201.

    I un-installed old maven and installed Maven 3.6.3, still got this error that Maven dependencies are failing with a 501 error.

    Realized it could be a truststore/keystore issue associated with requiring https. Found that you can now configure -Djavax options using a jvm.config file, see: https://maven.apache.org/configure.html.

    As I am also using Tomcat I copied the keystore & truststore config from Tomcat (setenv.sh) to my jvm.config and then it worked!

    There is also an option to pass the this config in 'export MAVEN_OPTS' (when using mvn generate) but although this stopped the 501 error it created another: it expected a pom file.

    Creating a separate jvm.config file works perfectly, just put it in the root of your project.

    Hopefully this helps someone, took me all day to figure it out!

提交回复
热议问题