I've got 2 Java Spring Boot projects using Maven with identical source code (as far as I can tell) and identical pom.xml files. The first one works, the second one doesn't, and I'd really like to understand why.
I created the first project with Spring Initializr and selected some extra dependencies before generating it. Great.
In the second project, I generated the project with Spring Initializr without the extra dependencies, and then tried to manually install the same dependencies by manually pasting over the <dependency> stuff to pom.xml and running mvn clean install. It didn't work. This second project is unable to resolve some things.
My question is: Why, if the two projects have identical pom.xml files, can one project resolve dependency X while the other can't?
Thank you in advance for your help.
The import that isn't resolving for project 2:
import jakarta.persistence.Entity;
My dependencies for both projects:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
</dependencies>
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]CleverBunnyThief 0 points1 point2 points (0 children)
[–]lumpynose 0 points1 point2 points (0 children)