maven 總結整理(二)——download source code


當我們用maven下載jar包時,有時希望下載jar包的源代碼,此時可以在pom.xml文件中,進行設置。

<build>
    <finalName>WebProject</finalName>
    <plugins>
          <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.2.3</version>
                <configuration>
                    <container>
                        <!-- 指明使用的tomcat服務器版本 -->
                        <containerId>tomcat7x</containerId>
                        <!--指明tomcat服務器的安裝目錄 -->
                        <home>C:\d\install_software\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75</home>
                    </container>
                    <configuration>
                        <type>existing</type>
                        <!--指明tomcat服務器的安裝目錄 -->
                        <home>C:\d\install_software\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75</home>
                    </configuration>
                    <configuration>
                      <downloadSources>true</downloadSources>
                      <downloadJavadocs>false</downloadJavadocs>
                  </configuration>
                </configuration>
                <executions>  
                  <execution>  
                      <id>cargo-run</id>  
                      <phase>install</phase>  
                      <goals>  
                          <goal>run</goal>  
                      </goals>  
                  </execution>  
              </executions>
          </plugin>
      </plugins>
  </build>


<configuration>標簽部分追加進來之后,重新編譯項目,就可以得到源代碼了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM