我一直在尝试设置GitLab-CI来在Raspbian中构建Maven Java项目,但每当它试图运行构建脚本时它都会失败,因为它无法找到Maven。我使用this指南来安装跑步者。
构建跟踪:
Running with gitlab-ci-multi-runner 1.10.4 (b32125f)
WARNING: image is not supported by selected executor and shell
Using Shell executor...
Running on raspberrypi...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/f09314a8/0/RBian/TestProject'...
Checking out 54d2e140 as master...
Skipping Git submodules setup
$ mvn clean package
bash: line 22: mvn: command not found
ERROR: Build failed: exit status 1
.gitlab-ci.yml
image: maven:3-jdk-8
build:
script: "mvn clean package"
artifacts:
name: "TestProject"
paths:
- "target/*.jar"
有谁知道是什么原因引起的?
编辑:修改/ etc / default将$ MAVEN_HOME / bin添加到$ PATH就可以了。
答案 0 :(得分:0)
尝试将 MAVEN_HOME 路径添加到 config.toml 环境字段中。
environment = ["MAVEN_HOME=/path/to/maven"]