在研究spring-project示例时,我发现了一个代码片段:

        <!-- HIBERNATE -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>


在那里工作正常,但是当我尝试将相同的片段添加到pom.xlm时,我得到了[ERROR] 'dependencies.dependency.version' for org.hibernate:hibernate-entitymanager:jar is missing.

给我解释一下,为什么它在这里https://github.com/spring-projects/spring-petclinic/blob/master/pom.xml起作用,但是在通用pom.xml中不起作用。

最佳答案

确保在您的<dependencyManagement>部分中也包含bom。此物料清单包含所有依赖项的版本。

有关Bom的更多信息,请参见this

09-30 15:21
查看更多