Gmavenplus: Unrecognized target bytecode

When you try to compile Groovy with Java and use gmavenplus plugin for that purpose, you may face with this errors:

Unrecognized target bytecode.
Unrecognized target bytecode '8'.
[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6:compileTests (default) on project test: Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6:compileTests failed: Unrecognized target bytecode. -> [Help 1]

To solve this problem, you need replace the ‘8’ to ‘1.8’ in your maven-compiler-plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

If you don’t have maven-compiler-plugin – add it to your project’s pom.xml, as above.

Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at promark33@gmail.com.

If I saved your day, you can support me 🤝