本文介绍了Maven – 总是下载源代码和 javadocs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以配置 maven 以始终下载源代码和 javadocs?每次都指定 -DdownloadSources=true -DdownloadJavadocs=true
(这通常伴随着运行 mvn compile 两次,因为我忘记了第一次)变得相当乏味.
Is there a way I can configure maven to always download sources and javadocs? Specifying -DdownloadSources=true -DdownloadJavadocs=true
everytime (which usually goes along with running mvn compile twice because I forgot the first time) becomes rather tedious.
推荐答案
打开您的 settings.xml 文件 ~/.m2/settings.xml
(如果它不存在,则创建它).添加一个添加了属性的部分.然后确保 activeProfiles 包含新的配置文件.
Open your settings.xml file ~/.m2/settings.xml
(create it if it doesn't exist). Add a section with the properties added. Then make sure the activeProfiles includes the new profile.
<settings>
<!-- ... other settings here ... -->
<profiles>
<profile>
<id>downloadSources</id>
<properties>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>downloadSources</activeProfile>
</activeProfiles>
</settings>
这篇关于Maven – 总是下载源代码和 javadocs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!