** Witam, podczas wrzucania mojej aplikacji Spring Boot do repozytorium na Heroku (robiąc to z użyciem Git Bash), pojawia się błąd: **
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project video-app: Fatal error compiling: invalid target release: 11 -> [Help 1]
** Aplikacja działa poprawnie, w celu jej wdrożenia wykonywałem wszystkie instrukcje znajdujące się na stronie heroku: **
$ heroku login
Create a new Git repository
Initialize a git repository in a new or existing directory
$ cd my-project/
$ git init
$ heroku git:remote -a video-app57
Deploy your application
Commit your code to the repository and deploy it to Heroku using Git.
$ git add .
$ git commit -am "make it better"
$ git push heroku master
** Błąd pojawił się po wpisaniu ostatniej komendy. W Intellij Idea ustawioną mam wersję Javy jako 14, w zmiennych środowiskowych:
- zmienną użytkownika: JAVA_HOME -> C:\Program Files\Java\jdk-14.0.1
- zmienną systemową: MAVEN_HOME -> C:\Program Files\apache-maven-3.6.3
- zmienną systemową: M2 -> C:\Program Files\apache-maven-3.6.3\bin
- zmienną systemową PATH ustawioną m. in. na katalogi bin javy i mavena
oraz w pliku pom.xml wersję javy ustawioną na 14 **
** Konfiguracja mavena: **
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\apache-maven-3.6.3\bin\..
Java version: 14.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-14.0.1
Default locale: pl_PL, platform encoding: Cp1250
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
** 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.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>pl.bykowski</groupId>
<artifactId>video-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>video-app</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>14</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</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>
</plugins>
</build>
</project>
Heroku currently uses OpenJDK 8 to run your application by default.