随笔-95  评论-31  文章-10  trackbacks-0
两种方式(在pom里面添加):
1: 直接在<build></build>标签中添加,这种方式缺点:只会根据你提供的目录及文件打入包中,而会忽略src/main/resources目录(如果不指定)
    <build>  
        
<finalName>test</finalName>
        
<resources>  
            
<resource>  
              
<directory>文件目录</directory>
               
<includes>  
                 
<include>**/*.后缀名</include>
               </includes>
               <filtering>false</filtering>  
            </resource>
        </resources>  
    </build> 

2:采用build-helper-maven-plugin插件,这种方式适合
<plugin>  
<groupId>org.codehaus.mojo</groupId>  
<artifactId>build-helper-maven-plugin</artifactId>  
<version>1.8</version>  
<executions>  
   
<execution>  
     
<id>add-resource</id>  
       
<phase>generate-resources</phase>  
       
<goals>  
         
<goal>add-resource</goal>  
       
</goals>  
     
<configuration>  
      
<resources>  
        
<resource>  
          
<directory>指定目录</directory>  
        
<includes>
          
<include>**/*.后缀名</include>  
        </includes>  
        </resource>  
      </resources>  
     </configuration>  
    </execution>  
</executions>  
</plugin>    


posted on 2015-07-16 12:58 朔望魔刃 阅读(667) 评论(0)  编辑  收藏 所属分类: java

只有注册用户登录后才能发表评论。


网站导航: