Maven版本管理的问题

发布于 2025-01-29 10:18:22 字数 1003 浏览 3 评论 0原文

我遇到的问题是,这是我的pom文件中的定义。\ \

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>2.0.0.RELEASE</version>
    </dependency>

在此依赖性中,它具有偏离依赖性,这是启动器,

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
      <version>2.0.0.RELEASE</version>
      <scope>compile</scope>
    </dependency>

但在我的maven树上,

[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.6.RELEASE:compile

通过该项目的方式 parent ,在父母中,有2.3.6起动器 - 依赖性。
我想知道为什么我引用的Web启动器中的亚依赖性启动器 - 距离我所引用的2.0.0不是我看到的2.0.0,而是父母依赖性中的2.3.6。

The problem I encountered is this, here is the definition in my POM file.\

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>2.0.0.RELEASE</version>
    </dependency>

In this dependency, It's having a sub-dependency which is starter-tomcat

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-tomcat</artifactId>
      <version>2.0.0.RELEASE</version>
      <scope>compile</scope>
    </dependency>

But In my maven tree

[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.6.RELEASE:compile

By the way this project have a parent, In parent There is a 2.3.6 starter-webdependency.

I want to know why the sub-dependency starter-tomcat in the web-starter I referenced 2.0.0 is not the 2.0.0 I see, but 2.3.6 in the parent dependency.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里南柯 2025-02-05 10:18:22

我得到了它。
解决此问题的方法有两种方法

  1. 不包括您的亚依赖性并添加新版本的依赖关系。
  2. 用于控制此脱离

I got it.
There are two ways to solve this question

  1. exclude your sub-dependency and add a new version dependency.
  2. use to control this denpendency
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文