我想知道我什么时候没有在某些模块的 pom.xml 中指定插件版本,例如:
<build>
...
<plugin>
<groudId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
...
</build>
Run Code Online (Sandbox Code Playgroud)
我运行“mvn compile”时使用的默认插件版本是什么?
我已经尝试过了,实际上它使用的是 maven-compiler-plugin 版本“3.1”,上面的插件元素已注释,我的 maven 版本是 3.6.3。
我花了 1 个小时通过 Maven 的文档和相关帖子在谷歌上搜索,但没有找到确切的答案。我真的很想知道那个版本是如何决定的?如果有人知道任何线索,不胜感激。
Rob*_*lte 11
神奇的事情不是发生在超级 pom 中,而是发生bindings descriptor在https://github.com/apache/maven/blob/master/maven-core/src/main/resources/META-INF/plexus/默认绑定.xml。但是,他们正在转向匹配的打包插件,例如 maven-jar-plugin,它位于https://github.com/apache/maven-jar-plugin/blob/master/src/main/filtered- resources/META-INF/plexus/components.xml
这些版本尚未更新,因为如果 2 个具有不同 Maven 版本的用户有不同的结果(例如,一个有损坏的构建,另一个则没有),那会很奇怪。因此最好在 pom 中指定插件版本,不要依赖 Maven 提供的默认版本。
最后,所有内容均在https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html进行了描述
| 归档时间: |
|
| 查看次数: |
918 次 |
| 最近记录: |