如果不在maven依赖中声明版本会发生什么?

问题描述 投票:0回答:1

我有一个项目正在运行,但在我的 pom.xml 中没有看到许多依赖项定义的版本

            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

想知道 Maven 从哪里获取版本?我在某处读到它从父文件中选择,但这里没有父 pom。

maven maven-2
1个回答
0
投票

它们是从父 POM 或 BOM(依赖管理中带有

<scope>import</scope>
的条目)中选取的。

© www.soinside.com 2019 - 2024. All rights reserved.