2011-03-17 2 views
4

maven war plugin usage page에서 인용 :Maven : 전쟁 전에 webapp 디렉토리를 정리하십시오 : 폭발?

<project> 
    ... 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.1.1</version> 
     <configuration> 
      <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    ... 
</project> 

어떻게 전쟁 파일을 폭발하기 전에 <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory>에 정의 된 디렉토리의 내용을 청소합니까?

내 경험에 따르면 webappDirectory로 정의 된 폴더는 정리되지 않으므로 webapp의 일부인 관련없는 파일을 갖게됩니다.

mvn -o clean <cleanWebappDirectory here?> install war:exploded 

감사합니다 : 난 현재이 같은입니다 webappDirectory을 청소 사용하여 현재 명령 메신저에 무언가를 추가 할 수 있습니다

은 멋진거야!

답변

6

청소할 필수 폴더를 지정하고 maven clean plugin을 추가하는 것이 좋습니다. 아래에있는 것 ... directory은 상대적이어야합니다.

<build> 
    [...] 
    <plugin> 
    <artifactId>maven-clean-plugin</artifactId> 
    <version>2.4.1</version> 
    <configuration> 
     <filesets> 
     <fileset> 
      <directory>sample/servlet/container/deploy/directory</directory> 
      <includes> 
      <include>*</include> 
      </includes> 
     </fileset> 
     </filesets> 
    </configuration> 
    </plugin> 
    [...] 
</build> 
+0

멋진 .. 감사합니다. ..-) – bertie