有两个远程服务器是礼物。假设我们将它们命名为A和B。我的java代码已在GIT存储库上提交并更新。我在服务器A和B上都提取了代码。当我在服务器A上使用mvn干净包安装时,它的工作正常并成功地完成了构建。但是,当我使用mvn干净包安装服务器B,它给我以下错误与构建失败按摩。
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] oagi-srt ........................................... SUCCESS [ 0.292 s]
[INFO] oagi-srt-common .................................... SUCCESS [ 1.959 s]
[INFO] oagi-srt-repository ................................ SUCCESS [ 2.357 s]
[INFO] oagi-srt-service ................................... SUCCESS [ 2.064 s]
[INFO] oagi-srt-import .................................... SUCCESS [ 3.064 s]
[INFO] oagi-srt-webapp .................................... FAILURE [ 21.398 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.539 s
[INFO] Finished at: 2017-08-10T11:50:10+00:00
[INFO] Final Memory: 44M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project srt-webapp: Could not resolve dependencies for project org.oagi:srt-webapp:war:1.0.0: Failed to collect dependencies at org.joinfaces:jsf-spring-boot-starter:jar:2.2.7 -> org.primefaces.extensions:all-themes:jar:1.0.8 -> org.primefaces.themes:afterdark:jar:1.0.8: Failed to read artifact descriptor for org.primefaces.themes:afterdark:jar:1.0.8: Could not transfer artifact org.primefaces.themes:themes-project:pom:1.0.8 from/to prime-repo-new (http://repository.primefaces.org): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :srt-webapp注意:如果我直接将项目war文件放在tomcat中并重新启动服务器,那么我的应用程序在这两台服务器上都能正常工作。
发布于 2017-08-10 12:06:08
您的B服务器似乎没有访问存储库的证书,请尝试比较服务器A和服务器B之间的环境证书。
发布于 2020-02-10 18:22:29
我的公司IT政策阻止了maven回购https,因为证书过期日期很短。进口证书是痛苦的。所以我用这种方法修复了它:
mvn clean package -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true发布于 2020-10-01 13:29:57
当我的JRE没有正确的证书通过我的公司代理并提交给回购时,我就会遇到这个问题。
步骤1将取决于您的IT部门。您需要找到让您通过https代理的.crt文件,并将其下载为Your_Proxy.crt
步骤2正在运行"mvn -version“,以100%确保您知道您的maven使用的是哪个JRE。
步骤3将在管理员模式下使用windows上的Powershell或linux上的sudo进入文件夹。
./bin/keytool.exe -importcert -ckeystore cacerts -file Your_Proxy.crt -alias Add_name_here..。您需要知道keystore的密码,它通常默认为"changeit“。
https://stackoverflow.com/questions/45612814
复制相似问题