2012-07-16 6 views
1

소스를 컴파일 할 때 이슈의 압축을 해제하려면 어떻게해야합니까?메이븐에서 아티팩트를 푸는 방법은 무엇입니까?

tar 파일을 압축 해제하기 전에 복사해야합니까?

나는

<build> 
     <plugins> 
     <plugin> 
      <artifactId>abcId</artifactId> 
      <version>1</version> 
      <executions> 
      <execution> 
       <id>abc untar</id> 
       <phase>process-resources</phase> 
       <goals> 
       <goal>exec</goal> 
       </goals> 

      <configuration> 
       <executable>tar</executable> 
       <workingDirectory>???</workingDirectory> 
       <arguments> 
       <argument>xvf abc.tar</argument> 
       </arguments> 
      </configuration> 
      </execution> 
      </executions> 
     </plugin> 
     </plugins> 
    </build> 
+0

[게시물에 서명 또는 태그 라인을 추가하지 마십시오.] (http://stackoverflow.com/faq#signatures). – meagar

답변

4

... 아래처럼 뭔가를 할 수 있습니다 untarmaven dependency plugindependency:unpack 목표를 이용하여 유물. 다음은 example의 수정 된 버전입니다.

 <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <version>2.4</version> 
     <executions> 
      <execution> 
      <id>unpack</id> 
      <phase>process-resources</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <artifactItems> 
       <artifactItem> 
        <groupId>artifact-groupId</groupId> 
        <artifactId>the-artifact</artifactId> 
        <version>a.b</version> 
        <type>tar</type> 
        <outputDirectory>${project.build.directory}/artifactLocation</outputDirectory> 
       </artifactItem> 
       </artifactItems> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
+0

감사합니다. 이것은 매력처럼 작동합니다. 당신에게 1000 upvotes가 있었으면 좋겠다. :) –

관련 문제