[英]Maven launch of Quarkus tests causes 401 unauthorized error when bootstrap attempts to get dependencies from Nexus repo
I've just set-up a Jenkins pipeline to test a small Quarkus app.我刚刚设置了一个 Jenkins 管道来测试一个小型 Quarkus 应用程序。 My Jenkins runs in a corporate Kubernetes-based CI/CD environment with corporate Nexus repositories.
My Jenkins 在具有企业 Nexus 存储库的基于 Kubernetes 的企业 CI/CD 环境中运行。 The first stage just tries to launch @QuarkusTests (that work locally in my IDE) with:
第一阶段只是尝试启动 @QuarkusTests(在我的 IDE 中本地工作):
mvn clean test -Dquarkus.test.profile=xxx
everything seems to build OK, but when the surefire plugin launches the QuarkusTests, the Quarkus bootstrap tries to get dependencies from the Nexus repo and fails with an HTTP 401 error.一切似乎都构建正常,但是当 surefire 插件启动 QuarkusTests 时,Quarkus 引导程序尝试从 Nexus 存储库获取依赖项并失败并出现 HTTP 401 错误。
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact io.quarkus:quarkus-bom:pom:2.15.0.Final from/to shp.mirror (http://<***************>/): authentication failed for http://<***************>/io/quarkus/quarkus-bom/2.15.0.Final/quarkus-bom-2.15.0.Final.pom, status: 401 Unauthorized
Dependencies were collected correctly from Nexus by Maven with no problems up until this stage.在此阶段之前,Maven 已从 Nexus 正确收集依赖项,没有任何问题。
I checked that the Jenkins user was able to reach the dependeny that failed.我检查了 Jenkins 用户是否能够访问失败的依赖项。
Things that I tried:我尝试过的事情:
<configuration>
<systemPropertyVariables>
<maven.home>${maven.home}</maven.home>
<maven.repo.local>${settings.localRepository}</maven.repo.local>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
<maven.top-level-basedir>${session.topLevelProject.basedir.absolutePath}</maven.top-level-basedir>
<quarkus.bootstrap.effective-model-builder>true</quarkus.bootstrap.effective-model-builder>
</systemPropertyVariables>
</configuration>
Any ideas on what may be causing this error, or on how to collect all the dependencies needed by Quarkus bootstrap would be geatly appreciated.对于可能导致此错误的原因或如何收集 Quarkus 引导程序所需的所有依赖项的任何想法,我们将不胜感激。
Thanks谢谢
Do you have java.net.ssl.*
properties set in MAVEN_OPTS
as documented in https://maven.apache.org/guides/mini/guide-repository-ssl.html ?您是否按照https://maven.apache.org/guides/mini/guide-repository-ssl.html中的说明在
MAVEN_OPTS
中设置了java.net.ssl.*
属性? If so, they will also need to be propagated to the surefire plugin.如果是这样,它们还需要传播到 surefire 插件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.