mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:config returns error when work with Java 17
chenrujun opened this issue · comments
Plugin name and version
com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:config
Plugin configuration in your pom.xml
Project to reproduce this problem: https://github.com/spring-guides/gs-spring-boot-for-azure/blob/dc68321c862c257be5adbd12ad155b46ed402326/README.adoc
Expected behavior
com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:config
Above command run succeed.
Actual behavior
When run this command:
mvn com.microsoft.azure:azure-spring-cloud-maven-plugin:1.3.0:config
It will return this error:
Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @5122e4bf
After upgrading the maven plugin version like this:
mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:config
It will return a new error:
[ERROR] Failed to execute goal com.microsoft.azure:azure-spring-apps-maven-plugin:1.14.0:config (default-cli) on project demo: generate configuration for Azure Spring Apps Maven plugin: Error creating extended parser class: Could not determine whether class 'org.jtwig.parser.parboiled.base.BooleanParser$$parboiled' has already been loaded: Unable to make protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String) accessible: module java.base does not "opens java.lang" to unnamed module @7bab5898 -> [Help 1]
Steps to reproduce the problem
Just follow the readme in this repo will reproduce this error: https://github.com/spring-guides/gs-spring-boot-for-azure/blob/dc68321c862c257be5adbd12ad155b46ed402326/README.adoc
Here is the workaround:
export MAVEN_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED"
I have the same behavior. For windows I added the variables manually as an environmental variable.
Related: #1044
Because Java 16 did disable illegal access, the warning has now turned into an error.
Hi, @wangmingliang-ms , is this problem been fixed in latest version? Is this have an ETA?
@chenrujun yes, it's fixed in the latest v1.16.0.
Thank you for your information.
Closing this issue.
Even after the workaround suggested by @chenrujun, it throws error. Please guide me
@rushi20139 what kind of error did you see? can you paste it here?
Hii, I went according to this : https://spring.io/guides/gs/spring-boot-for-azure/
Later came to know that it has 1.14 instead of 1.16.
In 1.16, it has been resolved and the plugin works as expected for this part.
@rushi20139 thanks, closing.