首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven依赖关系版本

Maven依赖关系版本
EN

Stack Overflow用户
提问于 2022-05-10 10:37:04
回答 1查看 75关注 0票数 0

在做mvn clean install -U时,我得到的是:

代码语言:javascript
运行
复制
[ERROR] Failed to execute goal on project xxx-security: Could not resolve dependencies for project xxx:xxx-security:jar:50-SNAPSHOT: Failed to collect dependencies at
xxx:xxx-persistence:jar:50-SNAPSHOT -> org.mybatis:mybatis:jar:${mybatis.version}: Failed to read artifact descriptor for org.mybatis:mybatis:jar:${mybatis.version}: Could not
transfer artifact org.mybatis:mybatis:pom:${mybatis.version} from/to nexus (http://example.net/repository/Standard/): Failed to transfer file: http://example.net/repository/Stan
dard/org/mybatis/mybatis/$%7Bmybatis.version%7D/mybatis-$%7Bmybatis.version%7D.pom. Return code is: 400 , ReasonPhrase:Invalid repository path. -> [Help 1]

我不明白的是为什么maven在url中使用mybatis.version来获取依赖项,而不是版本号。我已经搜索了代码,在那里找不到mybatis.version。我确实发现:

代码语言:javascript
运行
复制
<dependency>
   <groupId>org.mybatis</groupId>
   <artifactId>mybatis</artifactId>
   <version>3.0.4</version>
</dependency>

那么为什么maven使用的是mybatis.version而不是3.0.4呢?

EN

回答 1

Stack Overflow用户

发布于 2022-05-10 10:52:42

看起来您的xxx:xxx-persistence:jar:50-SNAPSHOT jar与org.mybatis:mybatis:jar:${mybatis.version}具有内部依赖关系。条件是在属性中定义mybatis.version

你可以这样做:

dependency.

  • Also

  • 执行mvn dependency:tree以检查哪个特定的jar在pom.xml<properties>部分下有这个<properties>定义<mybatis.version>3.0.4</mybatis.version>。您可以选择从定义<version>3.0.4</version>依赖项的<dependency>部分删除mybatis .

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72184789

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档