How to add JAX-B APIs during Citrus setup?

81 views Asked by At

I'm evaluating Citrus framework and I have problems with the setup. Following the documentation, I ran mvn archetype:generate -Dfilter=com.consol.citrus.mvn:citrus, selected option "Citrus quickstart project" and defined values for groupId and the others. Then I ran mvn clean verify and it failed with java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException. It seems that not all dependencies are included in the archetype, or that I need to choose another archetype. What is the recommended way to add the JAX-B APIs in my case? Should I use another archetype maybe?

OS: Windows 10 Enterprise amd64; JDK: RedHat OpenJDK 11; IDE: VS Code 1.50.1; Maven: 3.6.3; Citrus version: 2.7.3

1

There are 1 answers

0
Markus Neifer On BEST ANSWER

Fixed my Citrus framework setup on Java 11 by adding the JAXB Maven dependencies javax.xml.bind:jaxb-api and org.glassfish.jaxb:jaxb-runtime. Plus, I have upgraded maven-failsafe-plugin to version 2.22.2. Now, I can run mvn clean verify without errors and get build success.

See also Java: How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException and https://maven.apache.org/surefire/maven-failsafe-plugin/java9.html