使用maven編譯打包一個工程的示例

<build>
   <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
       <configuration>
         <source>7</source>
         <target>7</target>
         <encoding>UTF-8</encoding>
         <file.encoding>UTF-8</file.encoding>
       </configuration>
     </plugin>
         <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
    <version>2.17</version>
       <configuration>
       <argLine> -Dfile.encoding=UTF-8</argLine>
             <excludes>
                  <exclude>**/*.java</exclude>
             </excludes>
             
          <forkMode>once</forkMode>
       </configuration>
     </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </plugin>    
     
   </plugins>
   
 <resources>    
        <resource>    
            <directory>src/main/resources</directory>    
            <includes>    
                <include>**/*.*</include>    
            </includes>  
           <!-- <excludes>    
                <exclude>**/*.java</exclude>    
            </excludes>   -->
        </resource>    
    </resources>
 </build>
相關文章
相關標籤/搜索