[英]is jakarta.xml.bind.annotation.XmlRootElement is available?
I am working on Maven-jersey-Tomcat for rest-api development.我正在使用 Maven-jersey-Tomcat 进行 rest-api 开发。 but or xml type annotation @XmlRootElement or dependency javax.bind.annotation.XmlRootElement is not working... I have also attached screen shot as well
但是或 xml 类型注释 @XmlRootElement 或依赖 javax.bind.annotation.XmlRootElement 不起作用...我还附上了屏幕截图
use these dependency使用这些依赖
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
<version>3.0.1</version>
</dependency>
import jakarta.xml.bind.annotation.*;导入 jakarta.xml.bind.annotation.*;
Import this package, it will work with the above maven dependencies from Ashish bindra.导入此 package,它将与来自 Ashish bindra 的上述 maven 依赖项一起使用。
Note: Hope you are working with Telusko tutorials, I tested with that and it is working fine.注意:希望您正在使用 Telusko 教程,我对此进行了测试,并且运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.