Maven经验分享(五)Maven拷贝资源

上一章介绍使用ant拷贝资源,这里介绍maven拷贝资源,使用maven-resources-plugin插件。

<plugin> 
  <groupId>org.apache.maven.plugins</groupId>  
  <artifactId>maven-resources-plugin</artifactId>  
  <version>2.5</version>  
  <executions> 
    <execution> 
      <id>copy-dbscript</id>  
      <phase>package</phase>  
      <goals>
        <goal>copy-resources</goal>
      </goals>  
      <configuration> 
        <encoding>UTF-8</encoding>  
        <outputDirectory>../../target/dbscript</outputDirectory>  
        <resources> 
          <resource> 
            <directory>../../DM/dbscript/</directory> 
          </resource> 
        </resources> 
      </configuration> 
    </execution>  
    <execution> 
      <id>copy-releaseNotes</id>  
      <phase>package</phase>  
      <goals>
        <goal>copy-resources</goal>
      </goals>  
      <configuration> 
        <encoding>UTF-8</encoding>  
        <outputDirectory>../../target/releaseNotes</outputDirectory>  
        <resources> 
          <resource>
            <directory>../../DF/releaseNotes</directory>
          </resource> 
        </resources> 
      </configuration> 
    </execution> 
  </executions> 
</plugin>

 

猜你喜欢

转载自lipengjavablog.iteye.com/blog/2170191
今日推荐