我有这个pom.xml,其中
spring.boot.version
属性在父pom中定义,
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.seurop.eca.ocb.middyweb.mackoffice.server</groupId>
<artifactId>ocb-kw-mackoffice-server</artifactId>
<version>6.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>ocb-kw-mackoffice-server-annotations</artifactId>
<name>ocb-kw-mackoffice-server-annotations</name>
<!-- Properties Section -->
<properties>
<parent.version>6.0.0</parent.version>
<eclipselink.version>2.7.12</eclipselink.version>
<lombok.version>1.18.22</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
...
尽管如此,我还是有这个错误
org.springframework.boot:spring-boot-starter-data-jpa:jar:${spring.boot.version} was not found in...
spring-boot-starter-web 依赖项不包含 JPA(Java Persistence API)功能。它是一个单独的依赖项,需要显式添加。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.boot.version}</version>
</dependency>