Cosium / git-code-format-maven-plugin

A maven plugin that automatically deploys code formatters as pre-commit git hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java Records not supported?

mudlee opened this issue · comments

Hi.

I'm trying to validate my code with this great plugin. However, for my record files I get this:

[ERROR] Failed to execute goal com.cosium.code:git-code-format-maven-plugin:2.7:on-pre-commit (default-cli) on project api: com.google.googlejavaformat.java.FormatterException: 7:9: error: class, interface, or enum expected -> [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

Where can I turn on the --enable-preview flag?

Looks like Record formatting is available since gjf 1.8.
Therefore, please try with version 3.0 of this plugin.

Ah, it was just release 2 days ago :D Ok, with 3.0 it works! Thanks :)