I’ve recently migrated an application from Java 1.7 to Java 21 and upgraded to Spring Boot 3.3.X. Everything seems to be working fine except for one specific issue.
When I run the command mvn clean package, it reverts xml.bind. imports from jakarta back to javax. Even though I’ve committed and pushed the changes to the repository, the application still reverts the imports during the build process.
Current Imports (Committed):
import jakarta.xml. bind.annotation.XmlAccessType;
import jakarta.ml.bind.annotation.XmiAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmISchemaType;
import jakarta.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
Reverted Imports (During Build):
import javax xml.bind. annotation.XmlAccessType;
import javax-xml.bind-annotation.XmlAccessorType;
import javax-xml.bind.annotation.XmlElement;
import javax-xml.bind-annotation.XmISchemaType;
import javax.xml.bind.annotation.XmlType;
Why does Maven revert these imports to javax during the build process, and how can I ensure that the application consistently uses the jakarta imports? Could this be related to dependency management or plugin configuration in my pom.xml?
NB: Happens on IntelliJ or VS code
4