When upgrading the project from Spring Boot 2.7.18 to Spring Boot 3.1.12, I encountered the following errors:

  • When running mvn clean package, the submodules were not activated, causing an error and preventing the JAR file from being generated.
  • After running mvn compile and then mvn package, the JAR file was generated, but an error occurred during execution.

I have seen similar issues, but they don't seem to match what I'm experiencing.

This is a simple demo project. In the demo, the project runs correctly in IDEA, but it does not run properly with Maven.

Any help would be appreciated, thank you.

Comment From: Ayushkhodankar

Upgrading from Spring Boot 2.x to 3.x involves significant changes due to the underlying upgrade to Jakarta EE 9, which renames many packages from javax. to jakarta.. This can lead to various issues, especially with older code or dependencies that haven't been updated

Comment From: wilkinsona

The provided sample does not reproduce the behavior that you have described as it fails in the same way with both Spring Boot 2.7.x and 3.x. It's failing because you're packaging your admin module as a Spring Boot application and then common is trying to use it as a dependency. This section of the reference documentation is relevant here and explains what you need to do. If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.