2013-03-13 3 views
4

나는 사용자 정의 artfiact 유형이 web-module입니다. 단지 ZIP이지만 사용자 정의 확장자가 있습니다.Maven 커스텀 아카이브 확장 - 언팩 의존성은 어떻게 사용합니까?

다음 프로젝트에 따라 달라질 수 있습니다.이 사용자 지정 형식의 종속성을 언팩하고 싶습니다.

[INFO] Unknown archiver type 
Embedded error: No such archiver: 'web-module'. 
[INFO] ------------------------------------------------------------------------ 
[INFO] Trace 
org.apache.maven.lifecycle.LifecycleExecutionException: Unknown archiver type 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) 
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) 
    ... 

Googling를 수행하고 내 사용자 정의 플러그인의 components.xml 입력 unarchiver 사용자 정의를에서 지정할 수 있음을 이해 한 다음 maven-dependency-pluginunpack-dependencies 목표는 그러나 나는 오류가 계속 법안을 맞는 것 같았다. 내 components.xml 지금입니다 : 내 사용자 정의 플러그인의 설치되면

<component> 
    <role>org.codehaus.plexus.archiver.UnArchiver</role> 
    <role-hint>web-module</role-hint> 
    <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver</implementation> 
    <instantiation-strategy>per-lookup</instantiation-strategy> 
</component> 

것은 내가 다시 여전히 행운을 시도하지 하였다! 누구 내가 잘못 가고 있는지 알아?

또한 오류 확장 모듈의 POM에 사용자 정의 확장 플러그인을 추가하려고 시도했습니다 (<extensions>true</extensions>).

답변

0

은 다음과 같이 그것을 시도 :

<component-set> 
    <components> 
     <!-- Life-cycle mappings --> 
     <component> 
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> 
      <role-hint>web-module</role-hint> 
      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> 
      <configuration> 
       <phases> 
        <!-- You might need these as well. --> 
       </phases> 
      </configuration> 
     </component> 

     <!-- Artifact Handlers --> 
     <component> 
      <role>org.apache.maven.artifact.handler.ArtifactHandler</role> 
      <role-hint>web-module</role-hint> 
      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> 
      <configuration> 
       <extension>web-module</extension> 
       <type>web-module</type> 
       <packaging>web-module</packaging> 
      </configuration> 
     </component> 
    </components> 
</component-set>