Maven - 總是下載源代碼和javadoc有沒(méi)有辦法我可以配置maven 總是下載源和javadocs?-DdownloadSources=true -DdownloadJavadocs=true每次指定(通常伴隨著運(yùn)行mvn編譯兩次因?yàn)槲业谝淮瓮洠┳兊孟喈?dāng)乏味。
3 回答

守著星空守著你
TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超8個(gè)贊
打開(kāi)您的settings.xml文件~/.m2/settings.xml
(如果它不存在,則創(chuàng)建它)。添加添加了屬性的部分。然后確保activeProfiles包含新的配置文件。
<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>

夢(mèng)里花落0921
TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超6個(gè)贊
在我的情況下,“settings.xml”解決方案不起作用,所以我使用此命令來(lái)下載所有源:
mvn dependency:sources
您也可以將它與其他maven命令一起使用,例如:
mvn clean install dependency:sources -Dmaven.test.skip=true
要下載所有文檔,請(qǐng)使用以下命令:
mvn dependency:resolve -Dclassifier=javadoc

阿晨1998
TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊
來(lái)自Google的人的回答
在Eclipse中,您可以自動(dòng)下載javadoc和源代碼。
為此,右鍵單擊項(xiàng)目并使用
Maven - >下載JavaDoc
Maven - >下載源代碼
添加回答
舉報(bào)
0/150
提交
取消