Reputation: 65
After adding a plugin to my pom.xml I am getting this error.
An internal error occurred during: "Building". java.lang.reflect.InvocationTargetException
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
Upvotes: 1
Views: 6993
Reputation: 1
I am not sure about the later version, but if you are using the 1.6 version of xjc just change the JRE (whatever) to JavaSE-1.8. To change the JRE in eclipse, Right click on project -> Build Path -> Configure Build Path -> Libraries -> Select JRE System Library and click on edit button and then select the Execution Environment. Hope it works for you !!
Upvotes: 0
Reputation: 589
It's because you are building the application using JDK version 9 or above. It is supported till JDK 8.
Upvotes: 2
Reputation: 1
Right Click on project --> Run as --> Maven generate sources
Upvotes: 0
Reputation: 101
My issue was different and below maven plugin was causing the problem.
jaxb2-maven-plugin
It may be your xsd or wsdl issue, if maven is not able to compile it properly.
Upvotes: 0