사용자 도구

사이트 도구


java:maven:clean

문서의 이전 판입니다!


Maven Clean Plugin

target은 남겨두고 그 이하 디렉토리와 파일은 완전 삭제하게 하기

  • 이 기능이 필요한 이유는 Eclipse에서 Ctrl+Shfit+R 로 리소스 열기를 할 때 target 디렉토리 아래의 파일들이 자꾸 목록에 나오기 때문이다.
  • Eclipse에서 target 디렉토리의 속성(Properties)를 Derived로 지정하면 리소스 열기시 목록에서 제외된다.
  • 문제는, target이 삭제되었다 재생성될 경우, 다시 Derived로 설정을 해줘야한다는 점. 그래서 target 아래의 파일과 디렉토리만 삭제하고 target 자체는 삭제하지 않도록 설정 필요.
<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
        <excludeDefaultDirectories>true</excludeDefaultDirectories>
        <filesets>
            <fileset>
                <directory>target</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </fileset>
        </filesets>
    </configuration>
</plugin>
java/maven/clean.1326600818.txt.gz · 마지막으로 수정됨: 2012/01/15 13:13 저자 kwon37xi