简体   繁体   English

GitLab CI Maven依赖关系解析失败

[英]GitLab CI Maven dependency resolution fails

I want to setup a CI pipeline in GitLab for my Java project managed with Maven. 我想在GitLab中为使用Maven管理的Java项目设置CI管道。

This is my gitlab-ci.yml 这是我的gitlab-ci.yml

image: maven:3-jdk-9

variables:
   MAVEN_CLI_OPTS: "--batch-mode"

stages:
   - build

compile:
   stage: build
   script:
       - mvn $MAVEN_CLI_OPTS compile

I always get the following exception: 我总是收到以下异常:

在此处输入图片说明

I tried many things like changing versions of the plugins, various docker images, including a settings.xml and local repository in the project itself, but nothing works. 我尝试了很多事情,例如更改插件的版本,各种docker映像,包括项目本身中的settings.xml和本地存储库,但没有任何效果。

Thanks in advance for any help! 在此先感谢您的帮助!


UPDATE: Using the latest docker image everything works. 更新:使用最新的docker映像,一切正常。

It seems like the CI server has no connection to the internet. CI服务器似乎没有与Internet的连接。 Check this using the curl command in your .gitlab-ci.yml file. 使用.gitlab-ci.yml文件中的curl命令进行检查。

But I'm pretty sure you guys at daimler have a local mirror, something like Artifactory . 但是我敢肯定,戴姆勒的你们都有本地镜子,比如Artifactory
In that case you have to use a settings.xml file. 在这种情况下,您必须使用settings.xml文件。
Here is the official tutorial of Gitlab 这是Gitlab的官方教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM