0

需要一些帮助来帮助解决这个问题。

我正在运行我的 gitlab ci,以测试我的 maven 项目,一切正常,但是当它开始编译/构建/安装时收到以下错误:

Running with gitlab-runner 10.5.0 (80b03db9)
  on RolfsRunner 7d39f8f7
Using Shell executor...
Running on ISC-PRAKTIKANT...
Fetching changes...
Removing target/
HEAD is now at a7189518 7.2
Checking out a7189518 as rolf...
Skipping Git submodules setup
Checking cache for default...
Successfully extracted cache
$ cd C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform & mvn compile
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for de.immersight:imsPlatform:war:1.0
[WARNING] 'dependencies.dependency.systemPath' for immersight:imsLibrary:jar should use a variable instead of a hard-coded path C:\Users\Rolf\Desktop\imsLibrary-1.0.jar @ line 59, column 19
[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] ---------------------< de.immersight:imsPlatform >----------------------
[INFO] Building imsPlatform 1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ imsPlatform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform\de\immersight\stats\database\versions
[INFO] Copying 1 resource
[INFO] Copying 154 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ imsPlatform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 172 source files to C:\Program Files\GitLab-Runner\builds\7d39f8f7\0\dev\imsPlatform\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.769 s
[INFO] Finished at: 2018-03-13T13:05:58+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project imsPlatform: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] 
[ERROR] -> [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/MojoFailureException
Running after script...
$ echo CI_ENVIRONMENT_NAME
CI_ENVIRONMENT_NAME
ERROR: Job failed: exit status 1

我的 eclipse 和 windows cmd 编译正常,没有问题,安装了所有环境变量:

C:\Users\Rolf>mvn -version
    Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
    Maven home: C:\Users\Rolf\Maven-3.5.3\bin\..
    Java version: 1.8.0_161, vendor: Oracle Corporation
    Java home: C:\Program Files\Java\jdk1.8.0_161\jre
    Default locale: de_DE, platform encoding: Cp1252
    OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

C:\Users\Rolf>javac -version
javac 1.8.0_161
4

1 回答 1

0

我有同样的问题。安装 JDK 并编辑环境变量后,我必须以管理员权限重新启动我的 gitlab-runner。

gitlab-runner.exe restart

可能不再对你感兴趣了;)

于 2018-10-29T10:50:11.760 回答