2013-08-01 2 views
0

ear 파일에 패키지 된 jarModule에는 패키지 단계의 일부로 제거해야하는 persistence.xml 파일이 들어 있습니다. 내가 할 수있는 최선의 방법은 다음과 같습니다.maven-ear-plugin jarModule을 압축 해제, 필터 및 재 포장

<JarModule> 
<groupId>groupId</groupId> 
<artifactId>artifactId</artifactId> 
<unpack>true</unpack> --> 
</JarModule> 


<packagingExcludes>*/META-INF/persistence.xml,*/META-INF/orm.xml</packagingExcludes> 

하지만 포장하기 전에 다시 포장해야합니다.

제안 사항?

감사

답변

0

당신은 아카이브에서 파일을 제거 TrueZIP Maven PLugin를 사용할 수 있습니다

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>truezip-maven-plugin</artifactId> 
      <version>1.2</version> 
      <executions> 
       <execution> 
        <id>remove-from-jar</id> 
        <phase>prepare-package</phase> 
        <goals> 
         <goal>remove</goal> 
        </goals> 
        <configuration> 
         <fileset> 
          <directory>${project.build.directory}\<someFolders>\<I-contain-persistence-xml.jar></directory> 
          <includes> 
           <include>**\persistence.xml</include> 
           <include>**\orm.xml</include> 
          </includes> 
         </fileset> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

아카이브 (*의 .jar, * .WAR, ...)는 TrueZIP와 디렉토리처럼 사용할 수 있습니다. usage page에 표시된 것처럼 쉽게 아카이브의 파일을 이동하거나 복사 할 수 있습니다.

+0

감사합니다. – user2641043