Upgrading from Gmaven to gmavenplus-plugin.

5 views
Skip to first unread message

Poornima Baddi

unread,
Feb 13, 2024, 4:04:48 AMFeb 13
to GMavenPlus
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

Keegan Witt

unread,
Feb 14, 2024, 1:23:30 AMFeb 14
to Poornima Baddi, GMavenPlus
Have you tried the migration guide here?

If you share your configuration using GMavenPlus and the "other error" you got after migrating to GMavenPlus, I can probably help you better.

-Keegan

--
You received this message because you are subscribed to the Google Groups "GMavenPlus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmavenplus+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gmavenplus/cbda7e0c-a568-4a50-a599-05e96f0a17a6n%40googlegroups.com.

Poornima Baddi

unread,
Feb 14, 2024, 11:51:00 PMFeb 14
to GMavenPlus
Hi Keegan,

Thank you for your reply.
I could solve the issue with issue by reading docs.
Thank you once again.

Regards,
Poornima

Keegan Witt

unread,
Feb 15, 2024, 8:57:12 AMFeb 15
to Poornima Baddi, GMavenPlus
Glad you were able to solve your problem!

-Keegan

Reply all
Reply to author
Forward
0 new messages