Cześć, podczas wrzucania ( git push heroku main ) mojej aplikacji Spring Boot na heroku otrzymuję błąd:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ExchangeAPI: Fatal error compiling:
invalid target release: 11 -> [Help 1]
Aplikację już mam wrzuconą na gicie, wszystko tam jest aktualne.
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
mvn i java wygląda ok, zmienne środowiskowe ustawione prawidłowo:
Maven home: C:\Program Files\apache-maven-3.8.1\bin\..
Java version: 15.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-15.0.2
Default locale: pl_PL, platform encoding: Cp1250
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
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 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.4.4</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>pl.xxx</groupId>
<artifactId>ExchangeAPI</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ExchangeAPI</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.4.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
system.properties.txt
java.runtime.version=1.8 // czy też 11 nie zmienia mi nic na lepsze
maven.version=3.3.9 // jak tą linijkę usunąłem to też bez zmian
Widziałem, że problem już się pojawił ( może tam powinienem się pod ten temat podczepić a nie zakładać nowy? ) na forum:
Problem z deployem aplikacji Spring Boot
Wygląda na to, że u mnie jest wszystko prawidłowo a tutaj i tak nic z tego nie działa.
Jednak mam jednak jedno pytanie dot. dokumentacji heroku:
Heroku currently uses OpenJDK 8 to run your application by default.
Nie bardzo rozumiem o co tutaj chodzi, mam zmienić wersje javy wszędzie na 8? : X