Maven - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile Using java 10

Crøss Marian :

im trying to upload my discord bot project to Heroku using Git bash My project is java 10 and im using Maven but i get this error :

remote:        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bot_discord: Fatal error compiling: invalid flag: --release -> [Help 1]
remote:        [ERROR]
remote:        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote:        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote:        [ERROR]
remote:        [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote:        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
remote:
remote:  !     ERROR: Failed to build app with Maven
remote:        We're sorry this build is failing! If you can't find the issue in application code,
remote:        please submit a ticket so we can help: https://help.heroku.com/
remote:
remote:  !     Push rejected, failed to compile Java app.
remote:
remote:  !     Push failed

i think i need to add something to my Pom.xml but i dont understand what to add ! my 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>kino.bot</groupId>
  <artifactId>bot_discord</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Bot Ryo</name>
  <description>Mon bot</description>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <release>10</release>
        </configuration>
      </plugin>
    </plugins>
  </build>


  <repositories>
    <repository>
        <id>jcenter</id>
        <name>jcenter-bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
        <groupId>net.dv8tion</groupId>
        <artifactId>JDA</artifactId>
        <version>3.7.1_422</version>
    </dependency>
    <dependency>
        <groupId>com.mashape.unirest</groupId>
        <artifactId>unirest-java</artifactId>
        <version>1.4.9</version>
    </dependency>
  </dependencies>

</project>

what do i need to add to my pom.xml ?

codefinger :

Ensure that you have system.properties file in the root directory of your repository with the following contents:

java.runtime.version=10

For more info see the Heroku documentation on Java versions

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=92538&siteId=1