Repository navigation
Maven: "Fatal error compiling: invalid flag: --release -> [Help 1]" #1663
Description
Activity
@mpredli01 Could you clarify the exact command that you're running? Just
mvn packagefor example? Maybe a log of your terminal would be helpful. Also the version of Maven.I have tried this and was not able to reproduce.
Hi Santiago:
Here's the process in detail:
[a] Generate the Helidon 1.4.4 quickstart example:
$ mvn archetype:generate -DinteractiveMode=false \ -DarchetypeGroupId=io.helidon.archetypes \ -DarchetypeArtifactId=helidon-quickstart-se \ -DarchetypeVersion=1.4.4 \ -DgroupId=io.helidon.examples \ -DartifactId=helidon-quickstart-se \ -Dpackage=io.helidon.examples.quickstart.se[b] change directory to
helidon-quickstart-se
[c] executemvn clean packageon the command-line
[d] executejava -jar target/helidon-quickstart-se.jarThe application starts as expected.
[e] Generate the Helidon 2.0.0-M2 quickstart example:
mvn archetype:generate -DinteractiveMode=false \ -DarchetypeGroupId=io.helidon.archetypes \ -DarchetypeArtifactId=helidon-quickstart-se \ -DarchetypeVersion=2.0.0-M1 \ -DgroupId=io.helidon.examples \ -DartifactId=helidon-quickstart-se \ -Dpackage=io.helidon.examples.quickstart.se[f] change directory to
helidon-quickstart-se
[g] executemvn clean package
[h] ERROR: Here is the entire output:[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Detecting the operating system and CPU architecture [INFO] ------------------------------------------------------------------------ [INFO] os.detected.name: osx [INFO] os.detected.arch: x86_64 [INFO] os.detected.version: 10.15 [INFO] os.detected.version.major: 10 [INFO] os.detected.version.minor: 15 [INFO] os.detected.classifier: osx-x86_64 [INFO] [INFO] -------------< io.helidon.examples:helidon-quickstart-se >-------------- [INFO] Building helidon-quickstart-se 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ helidon-quickstart-se --- [INFO] [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ helidon-quickstart-se --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 4 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ helidon-quickstart-se --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 3 source files to /usr/local/apps/helidon-apps/helidon-quickstart-se/target/classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.662 s [INFO] Finished at: 2020-04-20T13:40:27-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project helidon-quickstart-se: Fatal error compiling: invalid flag: --release -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionI have Maven 3.63. installed on my laptop and running JDK 11. For both versions, there are warnings that look exactly the same. Please see the attached file for output on both versions.
Here is the attachment I mentioned...
Here is the attachment I mentioned...
That's very odd. Do you have any setting for archetype repositories in $HOME/.m2/settings.xml? Seems like the URL maven is trying to use should be HTTPS instead.
Just to triple check, can you share the output of
mvn --version? thanks.Hi Romain:
Here is the output of
mvn --version:Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /Users/mpredli01/.sdkman/candidates/maven/current Java version: 1.8.0_202, vendor: Amazon.com Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.15.4", arch: "x86_64", family: "mac"Hi Santiago:
I have a
archetype-catalog.xmlfile in that directory that contains the following related to databases:<?xml version="1.0" encoding="UTF-8"?> <archetype-catalog xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0 http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <archetypes> <archetype> <groupId>com.speedment.archetypes</groupId> <artifactId>speedment-archetype-mysql</artifactId> <version>3.0.1</version> <description>A collection of Maven Archetypes to make Speedment project creation easier. There should be one archetype for every supported DBMS.</description> </archetype> <archetype> <groupId>com.speedment.archetypes</groupId> <artifactId>speedment-archetype-postgresql</artifactId> <version>3.0.1</version> <description>A collection of Maven Archetypes to make Speedment project creation easier. There should be one archetype for every supported DBMS.</description> </archetype> <archetype> <groupId>com.speedment.archetypes</groupId> <artifactId>speedment-archetype-mariadb</artifactId> <version>3.0.1</version> <description>A collection of Maven Archetypes to make Speedment project creation easier. There should be one archetype for every supported DBMS.</description> </archetype> </archetypes> </archetype-catalog>Looks like you are using JDK8. Helidon 2.0 requires JDK11.
@romain-grecourt: I may have tried it with JDK 11, but I will change over to it and try again.
@romain-grecourt and @spericas:
Well, I feel like a complete dope. Changing to JDK 11 fixed everything, but I could have sworn that I was using it knowing that Helidon 2.0 will require JDK11+.
I apologize for having wasted everyone's time on this. I suppose having too many versions of the JDK can sometimes be a curse!
Thanks for your help!
Mike.
np, glad you got it to work.
Environment Details
Problem Description
Using the provided
mvncommand in the Helidon SE 2.0.0-M2 quickstart page, attempting to compile or package results in the following error:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project helidon-quickstart-se: Fatal error compiling: invalid flag: --release -> [Help 1]This error does not occur with the Helidon version 1.4.4 quickstart example.
With both quickstart versions, the generated
pom.xmlfile generated by the archetype was unedited.Steps to reproduce