1. 程式人生 > >為maven依賴包新增原始碼

為maven依賴包新增原始碼

一種方法用命令列:mvn dependency:sources或者mvn dependency:sources -DdownloadSources=true -DdownloadJavadocs=true,會下載原始碼在jar包相同路徑。 若沒有生效可以嘗試clean,然後就ok了。

另外一種在eclipse中,window->preference->maven->勾選download artifact sources,以及java doc

第三種在pom中,增加:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
        </configuration>
</plugin>