我正在尝试部署一个依赖于私有 GitLab Maven 存储库的 Spring Cloud 功能。尽管在 settings.xml 中给出了令牌,但 spring 云函数构建失败并出现以下错误:
Build failed: [INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.spring.sample:function-sample:jar:2.0.0.RELEASE
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 82, column 12
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 89, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------< io.spring.sample:function-sample >------------------
[INFO] Building function-sample 2.0.0.RELEASE
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from gitlab-maven: https://gitlab.com/<path-to-git-depencency>
[INFO] Downloading from gitlab-maven: https://gitlab.com/<path-to-git-depencency>
[WARNING] The POM for <library> is missing, no dependency information available
[INFO] Downloading from gitlab-maven: https://gitlab.com/<path-to-git-depencency>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.738 s
[INFO] Finished at: 2020-08-25T13:04:06Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project function-sample: Could not resolve dependencies for project io.spring.sample:function-sample:jar:2.0.0.RELEASE: Could not find artifact <library name>in gitlab-maven (<path-to-git-depencency>) -> [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 ID: efa79f31
设置.xml
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Private-Token</name>
<value>xxxx</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
POM.xml
<repository>
<id>gitlab-maven</id>
<url><gitlab-path></url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<name>central</name>
<url>https://repo.maven.apache.org/maven2/
</repository>
相同的代码在本地以及 GKE 集群中运行。我无法调试。有没有办法在云函数中运行 maven 命令来检查错误?