我添加了这样的插件:
<maven.surefire.version>3.0.0-M5</maven.surefire.version>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<parallel>methods</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
</configuration>
</plugin>…一切都很顺利。
我将版本更改为2.22.2,并得到了错误:Plugin 'org.apache.maven.plugins:maven-surefire-plugin:2.22.2' not found。
但是,当我从IntelliJ内部进行工件搜索时,它确实找到了该版本。好的,我把更改恢复到原来的版本。
现在,当我运行mvn test时,以下内容引起了我的注意:
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ regression-tests ---为什么不使用3.0.0-M5?2.12.4从何而来?我在我的pom.xml上搜索了“肯定火”,但是除了我上面显示的内容之外,没有其他的点击出现。
纵观IntelliJ的首选项,我发现正在使用的回购工具是https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/,所有提到的版本都在那里。
有人能跟我解释一下发生了什么吗?为什么找不到2.22.2呢?为什么它显示2.12.4被使用,而3.0.0-M5在pom.xml中?
为了完整起见,这是我的mvn:
❯ mvn --version
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /opt/homebrew/Cellar/maven/3.8.2/libexec
Java version: 1.8.0_292, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.5.2", arch: "aarch64", family: "mac"发布于 2021-09-01 12:18:14
,好的,我将更改恢复到原来的版本。
更改文件后,在Maven工具窗口中调用pom.xml Reload操作。
您可以看到Maven工具窗口中使用的插件版本:

您还可以在IDE中使用显示有效的POM操作来查看这个Maven项目中使用的所有实际依赖项、插件及其版本:

https://stackoverflow.com/questions/69010368
复制相似问题