Skip to content

Maven: "Fatal error compiling: invalid flag: --release -> [Help 1]" #1663

Description

@mpredli01

Environment Details

  • Helidon Version: 2.0.0-M2
  • Helidon SE
  • JDK version: 11
  • OS: macOS Catalina 10.15.4
  • Docker version (if applicable):

Problem Description

Using the provided mvn command 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.xml file generated by the archetype was unedited.

Steps to reproduce

  • Generate the Helidon SE 1.4.4 quickstart example and try to compile - it should do so as expected
  • Generate the Helidon SE 2.0.0-M2 quickstart example and try to compile - it should produce the error as I described above

Activity

  1. spericas commented on Apr 20, 2020

    @spericas
    Member

    @mpredli01 Could you clarify the exact command that you're running? Just mvn package for 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.

  2. self-assigned this
    on Apr 20, 2020
  3. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    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] execute mvn clean package on the command-line
    [d] execute java -jar target/helidon-quickstart-se.jar

    The 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] execute mvn 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/MojoExecutionException

    I 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.

  4. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    helidon-warnings.txt

    Here is the attachment I mentioned...

  5. spericas commented on Apr 20, 2020

    @spericas
    Member

    helidon-warnings.txt

    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.

  6. romain-grecourt commented on Apr 20, 2020

    @romain-grecourt
    Contributor

    Just to triple check, can you share the output of mvn --version ? thanks.

  7. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    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"

  8. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    Hi Santiago:

    I have a archetype-catalog.xml file 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>

  9. romain-grecourt commented on Apr 20, 2020

    @romain-grecourt
    Contributor

    Looks like you are using JDK8. Helidon 2.0 requires JDK11.

  10. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    @romain-grecourt: I may have tried it with JDK 11, but I will change over to it and try again.

  11. mpredli01 commented on Apr 20, 2020

    @mpredli01
    Author

    @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.

  12. romain-grecourt commented on Apr 20, 2020

    @romain-grecourt
    Contributor

    np, glad you got it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions