gitlab CI没有';t使用maven和Java10构建?
它使用的是Java8,但我改为Java10(我跟随了这篇文章:) 我得到这个错误:gitlab CI没有';t使用maven和Java10构建?,java,maven,gitlab-ci,java-10,Java,Maven,Gitlab Ci,Java 10,它使用的是Java8,但我改为Java10(我跟随了这篇文章:) 我得到这个错误: [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:47 min [INFO] Finished at: 2018-09-26T20:15:28Z [INFO] ------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:47 min
[INFO] Finished at: 2018-09-26T20:15:28Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project importparcoursup: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
gitlab-ci.yml
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn install:install-file -Dfile=lib/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar compile
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project 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/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nc.unc</groupId>
<artifactId>importparcoursup</artifactId>
<name>importparcoursup</name>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
</parent>
<dependencies>
// dependencies...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>10</release>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
</plugins>
</build>
</project>
4.0.0
北卡罗来纳大学
这意味着您正在使用JDK 8或更早版本进行编译。这个标志是在Java9中引入的。请参见mvn-v
进行验证。这意味着您正在使用JDK 8或更早版本进行编译。这个标志是在Java9中引入的。请参阅gitlab-ci.yml中的mvn-v
进行验证。
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn install:install-file -Dfile=lib/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar compile
替换
image: maven:latest
与
在gitlab-ci.yml中
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn install:install-file -Dfile=lib/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar compile
替换
image: maven:latest
与
编译在本地工作(我安装了Java10)。是在gitlab.com上出现了错误。我不知道如何强制gitlab使用Java10而不是8。编译在本地工作(我安装了Java10)。是在gitlab.com上出现了错误。我不知道如何强制gitlab使用Java10而不是Java8。