[英]Travis CI using the wrong version of Java
I've been trying to set up a Maven Project (Spring Boot) and connect it to Travis CI for the past 12 hours and it keeps failing.在过去的 12 小时里,我一直在尝试设置 Maven 项目(Spring Boot)并将其连接到 Travis CI,但一直失败。 It's driving me crazy.
这让我疯狂。 It looks like the virtual environment on Travis CI website is using the wrong version of Java as seen here
看起来 Travis CI 网站上的虚拟环境使用了错误版本的 Java,如此处所示
and和
Here are a few more screenshots that might helpful:以下是一些可能有帮助的屏幕截图:
My.bash_profile and JAVA_HOME are correctly set My.bash_profile 和 JAVA_HOME 设置正确
and finally my.travis.yml inside my spring boot project最后是我的 spring 引导项目中的 my.travis.yml
I created my Spring Boot project using this site: https://start.spring.io/ I didn't change anything expect the java version, I set it to 13 I created my Spring Boot project using this site: https://start.spring.io/ I didn't change anything expect the java version, I set it to 13
Here's what my pom.xml looks like:这是我的 pom.xml 的样子:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>13</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>13</source> <!-- 1.8,1.9,1.10,11,12,13 -->
<target>13</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Please help.请帮忙。 Thank you.
谢谢你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.