Git-commit-id-maven-plugin: Illegal reflective access warning in JDK11

Created on 21 Oct 2020  路  5Comments  路  Source: git-commit-id/git-commit-id-maven-plugin

When using JDK11 maven will output warning about Illegal reflective access, if there is need for escaping (probably this problem occurs if JDK9 or later is in use, not only in JDK11).

Workaround seems to be using outputWriter instead of outputStream in this line: https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/5f1dea451f80c95eb7ad51c4a202e3ecf4e09b3b/core/src/main/java/pl/project13/core/PropertiesFileGenerator.java#L105

More info in here: https://github.com/etiennestuder/java-ordered-properties/issues/5

bug

All 5 comments

Thanks for creating a ticket for that, I'll take a further look into this.

This reflective access is an error (by default) in JDK 16, which was released today. Could we get a new release with this fix?

Presumably it became an error because of JEP 396: Strongly Encapsulate JDK Internals by Default. Maybe there is an --illegal-access=permit or --add-exports=java.base/java.util=ALL-UNNAMED flag that one could add somewhere to work around this, but I don't understand the Maven plugin lifecycle enough to know where that would go.

Thanks for bringing that up! I thought I created a release with this fix included....apparently I miss remember...anyhow let me do that today. For any progress you can track https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/529.

@michaelhixson The new version should now be released. Let me know if you experience any issues.

I can confirm that 4.0.4 fixes that issue for me. Thanks!

Was this page helpful?
0 / 5 - 0 ratings