如何在Citrus安装过程中添加JAX-B API?

huangapple go评论73阅读模式
英文:

How to add JAX-B APIs during Citrus setup?

问题

我正在评估 Citrus 框架,并且在设置过程中遇到了问题。按照文档,我运行了以下命令:
mvn archetype:generate -Dfilter=com.consol.citrus.mvn:citrus
然后选择了选项“Citrus quickstart project”,并为 groupId 和其他内容定义了值。接着我运行了mvn clean verify,但出现了错误java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException。看起来并非所有依赖都包含在原型中,或者我需要选择另一个原型。在我这种情况下,推荐的添加 JAX-B APIs 的方法是什么?也许我应该使用另一个原型吗?

操作系统:Windows 10 企业版 amd64;JDK:RedHat OpenJDK 11;IDE:VS Code 1.50.1;Maven:3.6.3;Citrus 版本:2.7.3

英文:

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

得分: 0

修复了在Java 11上的Citrus框架设置,通过添加JAXB Maven依赖javax.xml.bind:jaxb-api和org.glassfish.jaxb:jaxb-runtime。此外,我将maven-failsafe-plugin升级到版本2.22.2。现在,我可以运行mvn clean verify,不会出现错误,并且构建成功。

另请参阅https://stackoverflow.com/questions/43574426/java-how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexceptio和https://maven.apache.org/surefire/maven-failsafe-plugin/java9.html。

英文:

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 https://stackoverflow.com/questions/43574426/java-how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexceptio and https://maven.apache.org/surefire/maven-failsafe-plugin/java9.html

huangapple
  • 本文由 发表于 2020年10月19日 17:53:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/64425006.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定