2012-11-01 6 views
0

일부 스크립트의 압축을 푸는 부모 POM이 있으므로 "pre-integration-test"단계에서 실행하고 모든 자식에 대해 기본적으로 실행합니다 모듈.사전 통합 테스트 단계에서 폴더 내용을 지우십시오.

내 문제는 여기에 그것이 실행될 때마다 특정 디렉토리의 내용을 삭제해야합니다. 사전 통합 단계에서 실행되지 않는 ant-plugin을 사용해 보았습니다. 또한 프로젝트를 작성하는 동안 여러 프로필을 호출합니다.

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-antrun-plugin</artifactId> 
    <executions> 
    <execution> 
     <id>compile</id> 
     <phase>pre-integration-test</phase> 
     <configuration> 
     <tasks> 
     <delete> 
      <fileset dir="checkout\myproject\specific_directory\**.*"/> 
     <delete/> 
     </tasks> 
     </configuration> 
     <goals> 
     <goal>run</goal> 
     </goals> 
    </execution> 
</executions> 

mvn clean install -Pprofile1,profile2,integration 

은 전반적으로 나는 깨끗한 개미 모든 사전 통합 단계에서 실행 등 4 플러그인이있다. 개미 정리 작업을 제외하고 다른 모든 작업은 올바르게 실행됩니다.

+0

maven-clean-plugin을 사용하지 않는 이유는 무엇입니까? – khmarbaise

+0

동일한 문제를 시도했지만 사전 통합 테스트 단계에서 실행되지 않았습니다. –

답변

2

문서 및 개인적인 경험에 근거하여 잘못된 영역에서 플러그인을 구성했다고 가정합니다. 또한 다음을 통해 mvn을 호출했습니다 :

mvn verify 

통합 테스트 단계를 실행하려면.

<build> 
    [...] 
    <plugin> 
    <artifactId>maven-clean-plugin</artifactId> 
    <version>2.5</version> 
    <executions> 
    <execution> 
     <id>cleanup</id> 
     <phase>pre-integration-test</phase> 
     <goals> 
     <goal>clean</goal> 
     </goals> 
     <configuration> 
     <filesets> 
      <fileset> 
      <directory>some/relative/path</directory> 
      <includes> 
       <include>**/*.tmp</include> 
       <include>**/*.log</include> 
      </includes> 
     </fileset> 
     </filesets> 
    </configuration> 
    </execution> 
    <executions> 
    </plugin> 
    [...] 
</build> 
관련 문제