@XmlElement - OpenJDK using Maven
I recently am trying open JDK, for obvious reasons the SUN libraries are not included as part of the openJDK runtime.
I am wondering what 开发者_开发百科I have to add to my POM file to use mavin to include the SUN libraries.
Currently in my environment I am using the following annotation.
package com.sun.xml.internal.txw2.annotation does not exist
@XmlElement
If this is javax.xml.bind.annotation.XmlElement
then you need to add dependencies to either JAXB or java-ee API.
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
Or
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
Both should be available on Maven Central. Note that the API dependencies will let you compile your code, but if you have any unit tests that actually use JAXB you'll also need to declare dependencies on an actual JAXB implementation.
You can try downloading the JAR containing the required classes and importing external dependencies into your project, but it will explode if the project is embedded on a continuous integration server.
精彩评论