【发布时间】:2018-02-22 14:38:43
【问题描述】:
我有一个 gitalb-runner 作为 docker 容器运行。
这是 mvn test 命令的失败工作:
Running with gitlab-runner 10.4.0 (857480b6)
on mvn-build (ae93a255)
Using Docker executor with image maven:3.3.9-jdk-8 ...
Using docker image sha256:b4b185fdfd711067c07e8a1df1257645aff2781402dc147e52d9a09636f9a139 for predefined container...
Pulling docker image maven:3.3.9-jdk-8 ...
Using docker image maven:3.3.9-jdk-8 ID=sha256:9997d8483b2fc521a4159feab922546dda0c5c22b5084f86dfab48f123ae4364 for build container...
Running on runner-ae93a255-project-2-concurrent-0 via 49682264df2f...
Fetching changes...
HEAD is now at e197d19 Fixed yml
Checking out e197d191 as dev...
Skipping Git submodules setup
$ echo "Building project with maven"
Building project with maven
$ mvn $MAVEN_OPTS test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rest-client
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.626 s
[INFO] Finished at: 2018-02-21T15:00:07+00:00
[INFO] Final Memory: 9M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.12.215] failed: Connection refused (Connection refused) -> [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/PluginResolutionException
ERROR: Job failed: exit code 1
我的问题是我真的需要设置代理并连接互联网吗? 还是有任何其他选项可以为 maven 提供缺少的插件?
我提到我已经在 config.toml 中配置了 repo 映射:
oncurrent = 1
check_interval = 0
[[runners]]
name = "mvn-build"
url = "http://192.168.233.128/"
token = "ae93a255f60d0e1abdb26cc9f72cd5"
executor = "docker"
[runners.docker]
tls_verify = false
image = "maven:3.3.9-jdk-8"
privileged = false
disable_cache = false
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock","/root/.m2/repository/:/root/.m2/repository/"]
shm_size = 0
[runners.cache]
【问题讨论】:
标签: docker continuous-integration gitlab gitlab-ci-runner