Import javax.xml.bind.annotation.XmlRootElement not allowed

I use intellij and my code uses

import javax.xml.bind.annotation.XmlRootElement;

It compiles and runs when I use the command line. However, when trying to run a test class using ide (intellij), it gives an error

package javax.xml.bind.annotation does not exists

I added jaxb dependency in my pom.xml

  <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.0</version> </dependency> 

What causes intellij not to detect this?

+6
source share

Source: https://habr.com/ru/post/949081/


All Articles