Hi,
Gmaven plugin with below code is working fine in Java 11.
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<properties>
<applicationPropertyFile>${project.build.directory}/properties/application.properties</applicationPropertyFile>
</properties>
<source>
def applicationPropertiesFile = new File(project.properties.applicationPropertyFile)
String properties = applicationPropertiesFile.getText();
project.properties.applicationProperties = properties.replace('\n', '\n ')
</source>
</configuration>
</execution>
</executions>
</plugin>
After upgrading to Java 17 above code is throwing below error
[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.4:execute (default) on project helm-smp-campaigneventsengine: java.lang.reflect.InaccessibleObjectException: Unable to make private void java.util.Hashtable.readObject(java.io.ObjectInputStream) throws java.io.IOException,java.lang.ClassNotFoundException accessible: module java.base does not "opens java.util" to unnamed module @5bc464fa -> [Help 1]
Tried adding --add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/
java.net=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED but no luck.
Upgraded gmaven-plugin to gmavenplus-plugin. But geting one or other error. How do we rewrite the above script with latest gmavenplus-plugin.
Could someone help to reslove this issue.
Regards,
Poornima