Maven - 总是下载源代码和javadoc [英] Maven – Always download sources and javadocs

查看:405
本文介绍了Maven - 总是下载源代码和javadoc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法可以将maven配置为始终下载源和javadocs?每次指定 -DdownloadSources = true -DdownloadJavadocs = true (这通常与运行mvn编译两次因为我第一次忘记)变得相当乏味。

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 - 总是下载源代码和javadoc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆