When I try to compile a Java project with the command that I have with maven I get an error
mvn clean package
it gives me this error
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.1:wsimport (wsimport) on project Promotions: Error executing: wsimport [-s, C:\Users\user\Documents\Project\Promotions\PromotionsClient\trunk\src\main\java,
-d, C:\Users\user\Documents\Project\Promotions\PromotionsClient\trunk\target\classes,
-Xnocompile, C:\Users\user\Documents\Project\Promotions\PromotionsClient\trunk\src\main\webapp\WEB-INF\wsdl\PromotionsManagement.wsdl]: InvocationTargetException: ExceptionInInitializerError: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @33364212 -> [Help 1]
And the pom marks me precisely this plugin that gives an error
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>wsimport</id>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>${wsdl_dir}</wsdlDirectory>
<wsdlFiles>
<wsdlFiles>PromotionsManagement.wsdl</wsdlFiles>
</wsdlFiles>
<!--<keep>true</keep> <xnocompile>true</xnocompile> -->
<sourceDestDir>src/main/java</sourceDestDir>
<!--<verbose>true</verbose> -->
<genWsdl>true</genWsdl>
</configuration>
</execution>
</executions>
</plugin>
I have tried updating the JDK version both new and old, I have changed the latest plugin version and also changing to org.codehaus.mojo but I can't find a way to fix it or compile it.
I am currently using JDK 18, I have a colleague who uses JDK 16 and he compiles it. I have tried with this version of JDK, but in my case it doesn't work. The JAVA_HOME checked and works with the indicated version and nothing.