Maven倉庫理解、如何引入本地包、Maven多種方式打可執行jar包

MAVEN依賴關係中Scope的作用

Java代碼  收藏代碼
  1. Dependency Scope 在POM 4中,<dependency>中還引入了<scope>,它主要管理依賴的部署。目前依賴項的作用域<scope>可以使用5個值:    
  2. 在定義項目的依賴項的時候,我們可以通過scope來指定該依賴項的作用範圍。scope的取值有compile、runtime、test、provided、system和import。  
  3. compile:這是依賴項的默認作用範圍,即當沒有指定依賴項的scope時默認使用compile。compile範圍內的依賴項在所有情況下都是有效的,包括運行、測試和編譯時。  
  4. runtime:表示該依賴項只有在運行時纔是需要的,在編譯的時候不需要。這種類型的依賴項將在運行和test的類路徑下可以訪問。  
  5. test:表示該依賴項只對測試時有用,包括測試代碼的編譯和運行,對於正常的項目運行是沒有影響的。  
  6. provided:表示該依賴項將由JDK或者運行容器在運行時提供,也就是說由Maven提供的該依賴項我們只有在編譯和測試時纔會用到,而在運行時將由JDK或者運行容器提供。  
  7. system:當scope爲system時,表示該依賴項是我們自己提供的,不需要Maven到倉庫裏面去找。指定scope爲system需要與另一個屬性元素systemPath一起使用,它表示該依賴項在當前系統的位置,使用的是絕對路徑。  

 

Java代碼  收藏代碼
  1. POM文件裏面可以引用一些內置屬性(Maven預定義可以直接使用)  
  2.   
  3. ${basedir} 項目根目錄   
  4. ${version}表示項目版本;  
  5. ${project.basedir}同${basedir};  
  6. ${project.version}表示項目版本,與${version}相同;  
  7. ${project.build.directory} 構建目錄,缺省爲target  
  8. ${project.build.sourceEncoding}表示主源碼的編碼格式;  
  9. ${project.build.sourceDirectory}表示主源碼路徑;  
  10. ${project.build.finalName}表示輸出文件名稱;  
  11. ${project.build.outputDirectory} 構建過程輸出目錄,缺省爲target/classes  

 

如何在Maven項目中引入本地包呢?

比如我從其它項目打一個jar包,引入到現有項目中。

方法一:將待引入的包放在目錄下如lib目錄下,修改pom文件,加入依賴並且scope要設置爲system

 

Java代碼  收藏代碼
  1. <dependencies>  
  2.     <dependency>  
  3.         <groupId>com.fbcds</groupId>  
  4.         <artifactId>fbcds</artifactId>  
  5.         <version>1.0</version>  
  6.         <scope>system</scope>  
  7.         <systemPath>${project.basedir}/lib/fbcds.jar</systemPath>  
  8.     </dependency>  
  9. </dependencies>  

 


 上面設置完成後,運行mvn package命令執行成功。但打出來的包裏面不包含lib目錄和fbcds.jar這個引用的包,即打出來的包不是可執行的jar。所以個人開發的話可以使用這種方式,如果團隊開發請使用方法二。

 

方法二:將待引入的jar包安裝到本地repository中

1、先把待引入的jar包放在一個目錄下,需要改一下包名,如fbcds.jar修改成fbcds-1.0.jar,如F:\lib目錄,在命令行CD到lib目錄,執行以下命令:

Java代碼  收藏代碼
  1. mvn install:install-file -Dfile=fbcds-1.0.jar -DgroupId=fbcds -DartifactId=fbcds -Dversion=1.0 -Dpackaging=jar  
  2. mvn install:install-file -Dfile=ojdbc7-1.0.jar -DgroupId=ojdbc7 -DartifactId=ojdbc7 -Dversion=1.0 -Dpackaging=jar  

 2、修改項目pom文件加入包對應的依賴

 

Java代碼  收藏代碼
  1. <dependencies>  
  2.     <dependency>  
  3.       <groupId>log4j</groupId>  
  4.       <artifactId>log4j</artifactId>  
  5.       <version>1.2.17</version>  
  6.     </dependency>  
  7.     <dependency>  
  8.       <groupId>fbcds</groupId>  
  9.       <artifactId>fbcds</artifactId>  
  10.       <version>1.0</version>  
  11.     </dependency>  
  12.     <dependency>   
  13.       <groupId>ojdbc7</groupId>  
  14.       <artifactId>ojdbc7</artifactId>  
  15.       <version>1.0</version>   
  16.     </dependency>  
  17.   </dependencies>  

 上面的fbcds和ojdbc7就是新加的引用包的依賴。

 完成後,在本地倉庫可看到對應的文件夾內容:



 

MAVEN如何打可執行的JAR包

前提條件:已成功將待引入的jar包安裝到本地repository中

方法一、使用maven-shade-plugin插件打可執行的jar包

插件查找鏈接:http://maven.apache.org/plugins/

1、測試類代碼

 

Java代碼  收藏代碼
  1. package com.lwf.test;  
  2.   
  3. import java.sql.Connection;  
  4. import java.sql.DriverManager;  
  5. import java.sql.ResultSet;  
  6. import java.sql.SQLException;  
  7. import java.sql.Statement;  
  8.   
  9. import com.eclink.fbcis.store.StoreDao;  
  10.   
  11. public class TestClass {  
  12.     public static void main(String[] args) {  
  13.         StoreDao a = new StoreDao();  
  14.         System.out.println("------" + a.toString());  
  15.         Connection con = null;  
  16.         Statement st = null;  
  17.         ResultSet rs = null;  
  18.         try {  
  19.             String sql = "select * from temp_head where temp_no='C530015I19008015'";  
  20.             Class.forName("oracle.jdbc.driver.OracleDriver");  
  21.             con = DriverManager.getConnection("jdbc:oracle:thin:@//10.101.2.19:1521/pdbqmytcis","qmytcis","qmytcis123");  
  22.             st = con.createStatement();  
  23.             rs = st.executeQuery(sql);  
  24.             if(rs.next()){  
  25.                 System.out.println(rs.getString("temp_no"));  
  26.             }  
  27.               
  28.         } catch (Exception e) {  
  29.             e.printStackTrace();  
  30.         } finally{  
  31.             try {  
  32.                 rs.close();  
  33.                 st.close();  
  34.                 con.close();  
  35.             } catch (SQLException e) {  
  36.                 e.printStackTrace();  
  37.             }  
  38.         }  
  39.     }  
  40. }  

 上面類中引用到了fbcds和ojdbc7包的內容。

2、對應pom文件

Java代碼  收藏代碼
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  2.   <modelVersion>4.0.0</modelVersion>  
  3.   <groupId>222</groupId>  
  4.   <artifactId>222</artifactId>  
  5.   <version>0.0.1-SNAPSHOT</version>  
  6.   <name>222</name>  
  7.   <dependencies>  
  8.     <dependency>  
  9.       <groupId>log4j</groupId>  
  10.       <artifactId>log4j</artifactId>  
  11.       <version>1.2.17</version>  
  12.     </dependency>  
  13.     <dependency>  
  14.       <groupId>fbcds</groupId>  
  15.       <artifactId>fbcds</artifactId>  
  16.       <version>1.0</version>  
  17.     </dependency>  
  18.     <dependency>   
  19.       <groupId>ojdbc7</groupId>  
  20.       <artifactId>ojdbc7</artifactId>  
  21.       <version>1.0</version>   
  22.     </dependency>  
  23.   </dependencies>  
  24.     <build>  
  25.         <plugins>  
  26.             <plugin>  
  27.                 <groupId>org.apache.maven.plugins</groupId>  
  28.                 <artifactId>maven-shade-plugin</artifactId>  
  29.                 <version>2.4.3</version>  
  30.                 <executions>  
  31.                     <execution>  
  32.                         <phase>package</phase>  
  33.                         <goals>  
  34.                             <goal>shade</goal>  
  35.                         </goals>  
  36.                         <configuration>  
  37.                             <transformers>  
  38.                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
  39.                                     <mainClass>com.lwf.test.TestClass</mainClass>  
  40.                                 </transformer>  
  41.                             </transformers>  
  42.                         </configuration>  
  43.                     </execution>  
  44.                 </executions>  
  45.             </plugin>  
  46.         </plugins>  
  47.     </build>  
  48.   
  49. </project>  

 在eclipse中右鍵項目run as 選擇Maven package,可看打包的target目錄內容:



 比較兩個包內容:



 執行包:cmd下



 original-MavenPackage-0.0.1-SNAPSHOT.jar中沒有主清單屬性是執行不了的。

 參見:http://www.mkyong.com/maven/create-a-fat-jar-file-maven-shade-plugin/

方法二、使用maven-assembly-plugin插件打可執行的jar包

測試類與方法一中一樣,只是pom不一樣,pom文件如下:

Java代碼  收藏代碼
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  2.   <modelVersion>4.0.0</modelVersion>  
  3.   <groupId>com.lwf.MavenPackage</groupId>  
  4.   <artifactId>MavenPackage</artifactId>  
  5.   <version>0.0.1-SNAPSHOT</version>  
  6.   <name>MavenPackage</name>  
  7.   <dependencies>  
  8.     <dependency>  
  9.       <groupId>log4j</groupId>  
  10.       <artifactId>log4j</artifactId>  
  11.       <version>1.2.17</version>  
  12.     </dependency>  
  13.     <dependency>  
  14.       <groupId>fbcds</groupId>  
  15.       <artifactId>fbcds</artifactId>  
  16.       <version>1.0</version>  
  17.     </dependency>  
  18.     <dependency>   
  19.       <groupId>ojdbc7</groupId>  
  20.       <artifactId>ojdbc7</artifactId>  
  21.       <version>1.0</version>   
  22.     </dependency>  
  23.   </dependencies>  
  24.     <build>  
  25.         <plugins>  
  26. <!-- 使用 maven-shade-plugin插件打可執行包-->  
  27. <!--   
  28.             <plugin>  
  29.                 <groupId>org.apache.maven.plugins</groupId>  
  30.                 <artifactId>maven-shade-plugin</artifactId>  
  31.                 <version>2.4.3</version>  
  32.                 <executions>  
  33.                     <execution>  
  34.                         <phase>package</phase>  
  35.                         <goals>  
  36.                             <goal>shade</goal>  
  37.                         </goals>  
  38.                         <configuration>  
  39.                             <transformers>  
  40.                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
  41.                                     <mainClass>com.lwf.test.TestClass</mainClass>  
  42.                                 </transformer>  
  43.                             </transformers>  
  44.                         </configuration>  
  45.                     </execution>  
  46.                 </executions>  
  47.             </plugin>  
  48. -->               
  49.   
  50. <!-- 使用 maven-Assembly-plugin插件打可執行包-->  
  51.             <plugin>  
  52.                 <groupId>org.apache.maven.plugins</groupId>  
  53.                 <artifactId>maven-assembly-plugin</artifactId>  
  54.                 <version>2.6</version>  
  55.                 <configuration>  
  56.                     <!-- get all project dependencies -->  
  57.                     <descriptorRefs>  
  58.                         <descriptorRef>jar-with-dependencies</descriptorRef>  
  59.                     </descriptorRefs>  
  60.                     <!-- MainClass in mainfest make a executable jar -->  
  61.                     <archive>  
  62.                       <manifest>  
  63.                         <mainClass>com.lwf.test.TestClass</mainClass>  
  64.                       </manifest>  
  65.                     </archive>  
  66.                 </configuration>  
  67.                 <executions>  
  68.                   <execution>  
  69.                     <id>make-assembly</id>  
  70.                     <phase>package</phase>   
  71.                     <goals>  
  72.                         <goal>single</goal>  
  73.                     </goals>  
  74.                   </execution>  
  75.                 </executions>  
  76.             </plugin>  
  77.         </plugins>  
  78.     </build>  
  79.   
  80. </project>  

 修改完pom後,在eclipse中右鍵項目run as 選擇Maven package,可看打包的target目錄內容:



 兩個jar文件比較:



 



 

 參見:http://www.mkyong.com/maven/create-a-fat-jar-file-maven-assembly-plugin/

方法三、使用onejar-maven-plugin插件打可執行的jar包

測試類與方法一中一樣,只是pom不一樣,pom文件如下:

Java代碼  收藏代碼
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  2.   <modelVersion>4.0.0</modelVersion>  
  3.   <groupId>com.lwf.MavenPackage</groupId>  
  4.   <artifactId>MavenPackage</artifactId>  
  5.   <version>0.0.1-SNAPSHOT</version>  
  6.   <name>MavenPackage</name>  
  7.   <dependencies>  
  8.     <dependency>  
  9.       <groupId>log4j</groupId>  
  10.       <artifactId>log4j</artifactId>  
  11.       <version>1.2.17</version>  
  12.     </dependency>  
  13.     <dependency>  
  14.       <groupId>fbcds</groupId>  
  15.       <artifactId>fbcds</artifactId>  
  16.       <version>1.0</version>  
  17.     </dependency>  
  18.     <dependency>   
  19.       <groupId>ojdbc7</groupId>  
  20.       <artifactId>ojdbc7</artifactId>  
  21.       <version>1.0</version>   
  22.     </dependency>  
  23.   </dependencies>  
  24.     <build>  
  25.         <plugins>  
  26. <!-- 使用 maven-shade-plugin插件打可執行包-->  
  27. <!--   
  28.             <plugin>  
  29.                 <groupId>org.apache.maven.plugins</groupId>  
  30.                 <artifactId>maven-shade-plugin</artifactId>  
  31.                 <version>2.4.3</version>  
  32.                 <executions>  
  33.                     <execution>  
  34.                         <phase>package</phase>  
  35.                         <goals>  
  36.                             <goal>shade</goal>  
  37.                         </goals>  
  38.                         <configuration>  
  39.                             <transformers>  
  40.                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
  41.                                     <mainClass>com.lwf.test.TestClass</mainClass>  
  42.                                 </transformer>  
  43.                             </transformers>  
  44.                         </configuration>  
  45.                     </execution>  
  46.                 </executions>  
  47.             </plugin>  
  48. -->               
  49.   
  50. <!-- 使用 maven-Assembly-plugin插件打可執行包-->  
  51. <!--   
  52.             <plugin>  
  53.                 <groupId>org.apache.maven.plugins</groupId>  
  54.                 <artifactId>maven-assembly-plugin</artifactId>  
  55.                 <version>2.6</version>  
  56.                 <configuration>  
  57.                     <descriptorRefs>  
  58.                         <descriptorRef>jar-with-dependencies</descriptorRef>  
  59.                     </descriptorRefs>  
  60.                     <archive>  
  61.                       <manifest>  
  62.                         <mainClass>com.lwf.test.TestClass</mainClass>  
  63.                       </manifest>  
  64.                     </archive>  
  65.                 </configuration>  
  66.                 <executions>  
  67.                   <execution>  
  68.                     <id>make-assembly</id>  
  69.                     <phase>package</phase>   
  70.                     <goals>  
  71.                         <goal>single</goal>  
  72.                     </goals>  
  73.                   </execution>  
  74.                 </executions>  
  75.             </plugin>  
  76. -->                   
  77.             <!-- 使用 onejar-maven-plugin插件打可執行包-->  
  78.             <plugin>  
  79.                 <groupId>org.apache.maven.plugins</groupId>  
  80.                 <artifactId>maven-jar-plugin</artifactId>  
  81.                 <configuration>  
  82.                     <archive>  
  83.                         <manifest>  
  84.                             <mainClass>com.lwf.test.TestClass</mainClass>  
  85.                         </manifest>  
  86.                     </archive>  
  87.                 </configuration>  
  88.             </plugin>  
  89.             <plugin>  
  90.                 <groupId>com.jolira</groupId>  
  91.                 <artifactId>onejar-maven-plugin</artifactId>  
  92.                 <version>1.4.4</version>  
  93.                 <executions>  
  94.                     <execution>  
  95.                         <configuration>  
  96.                             <attachToBuild>true</attachToBuild>  
  97.                             <classifier>onejar</classifier>  
  98.                         </configuration>  
  99.                         <goals>  
  100.                             <goal>one-jar</goal>  
  101.                         </goals>  
  102.                     </execution>  
  103.                 </executions>  
  104.             </plugin>  
  105.         </plugins>  
  106.     </build>  
  107. </project>  

打包截圖如下:




 

 
 

參見:http://www.mkyong.com/maven/maven-create-a-fat-jar-file-one-jar-example/

上文中因googlecode中已沒有onejar-maven-plugin所以另請參見下文:

http://my.oschina.net/noahxiao/blog/78241

方法四:使用maven-jar-plugin和maven-dependency-plugin打可執行包,引用的包放包外面文件夾下

其他不變,pom文件如下

Java代碼  收藏代碼
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  2.   <modelVersion>4.0.0</modelVersion>  
  3.   <groupId>com.lwf.MavenPackage</groupId>  
  4.   <artifactId>MavenPackage</artifactId>  
  5.   <version>0.0.1-SNAPSHOT</version>  
  6.   <name>MavenPackage</name>  
  7.   <dependencies>  
  8.     <dependency>  
  9.       <groupId>log4j</groupId>  
  10.       <artifactId>log4j</artifactId>  
  11.       <version>1.2.17</version>  
  12.     </dependency>  
  13.     <dependency>  
  14.       <groupId>fbcds</groupId>  
  15.       <artifactId>fbcds</artifactId>  
  16.       <version>1.0</version>  
  17.     </dependency>  
  18.     <dependency>   
  19.       <groupId>ojdbc7</groupId>  
  20.       <artifactId>ojdbc7</artifactId>  
  21.       <version>1.0</version>   
  22.     </dependency>  
  23.   </dependencies>  
  24.     <build>  
  25.         <plugins>  
  26. <!-- 方法一:使用 maven-shade-plugin插件打可執行包-->  
  27. <!--   
  28.             <plugin>  
  29.                 <groupId>org.apache.maven.plugins</groupId>  
  30.                 <artifactId>maven-shade-plugin</artifactId>  
  31.                 <version>2.4.3</version>  
  32.                 <executions>  
  33.                     <execution>  
  34.                         <phase>package</phase>  
  35.                         <goals>  
  36.                             <goal>shade</goal>  
  37.                         </goals>  
  38.                         <configuration>  
  39.                             <transformers>  
  40.                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
  41.                                     <mainClass>com.lwf.test.TestClass</mainClass>  
  42.                                 </transformer>  
  43.                             </transformers>  
  44.                         </configuration>  
  45.                     </execution>  
  46.                 </executions>  
  47.             </plugin>  
  48. -->               
  49.   
  50. <!-- 方法二:使用 maven-Assembly-plugin插件打可執行包-->  
  51. <!--   
  52.             <plugin>  
  53.                 <groupId>org.apache.maven.plugins</groupId>  
  54.                 <artifactId>maven-assembly-plugin</artifactId>  
  55.                 <version>2.6</version>  
  56.                 <configuration>  
  57.                     <descriptorRefs>  
  58.                         <descriptorRef>jar-with-dependencies</descriptorRef>  
  59.                     </descriptorRefs>  
  60.                     <archive>  
  61.                       <manifest>  
  62.                         <mainClass>com.lwf.test.TestClass</mainClass>  
  63.                       </manifest>  
  64.                     </archive>  
  65.                 </configuration>  
  66.                 <executions>  
  67.                   <execution>  
  68.                     <id>make-assembly</id>  
  69.                     <phase>package</phase>   
  70.                     <goals>  
  71.                         <goal>single</goal>  
  72.                     </goals>  
  73.                   </execution>  
  74.                 </executions>  
  75.             </plugin>  
  76. -->        
  77.              
  78. <!-- 方法三:使用 onejar-maven-plugin插件打可執行包-->  
  79. <!--           
  80.             <plugin>  
  81.                 <groupId>org.apache.maven.plugins</groupId>  
  82.                 <artifactId>maven-jar-plugin</artifactId>  
  83.                 <configuration>  
  84.                     <archive>  
  85.                         <manifest>  
  86.                             <mainClass>com.lwf.test.TestClass</mainClass>  
  87.                         </manifest>  
  88.                     </archive>  
  89.                 </configuration>  
  90.             </plugin>  
  91.             <plugin>  
  92.                 <groupId>com.jolira</groupId>  
  93.                 <artifactId>onejar-maven-plugin</artifactId>  
  94.                 <version>1.4.4</version>  
  95.                 <executions>  
  96.                     <execution>  
  97.                         <configuration>  
  98.                             <attachToBuild>true</attachToBuild>  
  99.                             <classifier>onejar</classifier>  
  100.                         </configuration>  
  101.                         <goals>  
  102.                             <goal>one-jar</goal>  
  103.                         </goals>  
  104.                     </execution>  
  105.                 </executions>  
  106.             </plugin>  
  107.               
  108.      -->          
  109.           
  110. <!-- 方法四:使用maven-jar-plugin和maven-dependency-plugin打可執行包,引用的包放包外面文件夾下 -->  
  111.             <plugin>  
  112.                 <groupId>org.apache.maven.plugins</groupId>  
  113.                 <artifactId>maven-jar-plugin</artifactId>  
  114.                 <configuration>  
  115.                   <excludes>  
  116.                     <exclude>**/log4j.properties</exclude>  
  117.                   </excludes>  
  118.                   <archive>  
  119.                     <manifest>  
  120.                     <addClasspath>true</addClasspath>  
  121.                     <mainClass>com.lwf.test.TestClass</mainClass>  
  122.                     <classpathPrefix>lib/</classpathPrefix>  
  123.                     </manifest>  
  124.                   </archive>  
  125.                 </configuration>  
  126.             </plugin>  
  127.   
  128.             <!-- Copy project dependency -->  
  129.             <plugin>  
  130.                 <groupId>org.apache.maven.plugins</groupId>  
  131.                 <artifactId>maven-dependency-plugin</artifactId>  
  132.                 <version>2.5.1</version>  
  133.                 <executions>  
  134.                   <execution>  
  135.                     <id>copy-dependencies</id>  
  136.                     <phase>package</phase>  
  137.                     <goals>  
  138.                         <goal>copy-dependencies</goal>  
  139.                     </goals>  
  140.                     <configuration>  
  141.                       <!-- exclude junit, we need runtime dependency only -->  
  142.                       <includeScope>runtime</includeScope>  
  143.                       <outputDirectory>${project.build.directory}/lib/</outputDirectory>  
  144.                     </configuration>  
  145.                   </execution>  
  146.                 </executions>  
  147.             </plugin>              
  148.         </plugins>  
  149.     </build>  
  150. </project>  

 



可以看到依賴的包拷貝到了lib目錄下,打的包裏沒有依賴包的信息,只是簡單的包,不過Manifest文件class-path要包含引用名的路徑

Java代碼  收藏代碼
  1. Manifest-Version: 1.0  
  2. Built-By: lweifeng  
  3. Build-Jdk: 1.7.0_17  
  4. Class-Path: lib/log4j-1.2.17.jar lib/fbcds-1.0.jar lib/ojdbc7-1.0.jar  
  5. Created-By: Apache Maven 3.3.9  
  6. Main-Class: com.lwf.test.TestClass  
  7. Archiver-Version: Plexus Archiver  

 
 在以上前三種插件打包方式中,maven-shade-plugin和maven-assembly-plugin採取的是將依賴包解壓再一併打到新包中,這樣依賴包可能存在衝突的時候,導致運行時可能出現未知問題,而onejar-maven-plugin打包是將依賴包自動歸入lib目錄,不解壓原包,相當於在原包基礎上加殼,這樣可以避免衝突的發生。第四種方法即是我們原來ant打包所使用的方法。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章