2012-07-11 2 views
3

나는 3 개의 전쟁 모듈이 귀 모듈에 패키지되어있는 프로젝트가 있습니다. 내 문제는 각각의 라이브러리 병이 전쟁 모듈과 귀 모듈에 포함되어 귀마개가 실제로 커질 수 있다는 것입니다 (약 190MB). warpath와 메이븐 스키니 전쟁

내가 여기 받는다는와 마른 전쟁을 만들기에 대한 자습서 다음이와 http://maven.apache.org/plugins/maven-war-plugin/examples/skinny-wars.html

을, 나는 좋은 45메가바이트, 주위에 아래로 귀의 크기를 얻을 수 있었다,하지만 난 배포하려고 할 때 글래스 피시하기 그것은 누락 된 수업에 대해 불평했다.

이것이 warfile로 패키지 된 appfuse-struts에 대한 종속성 때문이었습니다. 이것은 war-project 중 하나에서 warpath dependecy를 사용하여 포함됩니다.

마른 전쟁을 만드는 방법에 대한 자습서에는 전쟁에서 발견 된 모든 종속성도 정의되어야한다고 명시되어 있기 때문에. 나는 이것을 시도했지만, appfuse-struts 의존성이 warpath가되어서 이것이 작동하지 않게되었다. (귀부족에만 전쟁 의존성을 추가하면 클래스의 일부를 찾지 못한다고 불평하고 warpath 의존성을 추가 할 때 warpath가 무엇인지 알지 못한다고 불평합니다.)

전쟁이 전쟁 의존성을 사용하는 경우 마른 전쟁으로 귀를 만드는 방법을 알고 있습니까?

답변

5

가 나는 해결책을 찾을 수도 생각한다. 마른 전쟁 튜토리얼에서

를 하나 추가하는 WEB-INF/lib 디렉토리/* 항아리 packagingExcludes로 가정된다. 그런 다음 모든 종속성을 ear-configuration에 추가하여 항아리에서 사용할 수 있도록했습니다.

war-package 종속성은 ear 라이브러리의 lib 폴더에 전이 종속성이 추가되지 않으므로 ear lib 폴더 또는 WEB-INF/lib 폴더로 이동해야합니다. 전쟁 패키지.

나는 마지막 파일과 함께 war 파일의 WEB-INF/lib에 추가하기로했다.

이렇게하려면 먼저 mvn dependency:tree을 수행하여 war/warpath 자원이 포함 된 전쟁 프로젝트의 종속성 트리를 가져옵니다.

다음으로 전쟁 경로를 찾으십시오. 내 경우에는 다음과 같이 보입니다 :

 +- org.appfuse:appfuse-struts:warpath:2.0.2:compile 
     | +- org.appfuse:appfuse-web-common:war:2.0.2:compile 
     | +- org.appfuse:appfuse-web-common:warpath:2.0.2:compile 
     | +- displaytag:displaytag:jar:1.1.1:compile 
     | | \- org.slf4j:jcl104-over-slf4j:jar:1.4.2:compile 
     | +- commons-fileupload:commons-fileupload:jar:1.2.1:compile 
     | +- org.apache.commons:commons-io:jar:1.3.2:compile 
     | +- org.appfuse:appfuse-service:jar:2.0.2:compile 
     | | +- velocity:velocity:jar:1.4:compile 
     | | | \- velocity:velocity-dep:jar:1.4:runtime 
     | | +- org.codehaus.xfire:xfire-java5:jar:1.2.6:compile 
     | | | +- org.codehaus.xfire:xfire-aegis:jar:1.2.6:compile 
     | | | | \- net.java.dev.stax-utils:stax-utils:jar:20040917:compile 
     | | | +- org.codehaus.xfire:xfire-annotations:jar:1.2.6:compile 
     | | | +- xfire:xfire-jsr181-api:jar:1.0-M1:compile 
     | | | \- org.codehaus.xfire:xfire-core:jar:1.2.6:compile 
     | | |  +- stax:stax-api:jar:1.0.1:compile 
     | | |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.0:compile 
     | | |  \- commons-httpclient:commons-httpclient:jar:3.0:compile 
     | | \- org.codehaus.xfire:xfire-spring:jar:1.2.6:compile 
     | |  +- org.apache.xbean:xbean-spring:jar:2.8:compile 
     | |  \- org.codehaus.xfire:xfire-xmlbeans:jar:1.2.6:compile 
     | |  \- xmlbeans:xbean:jar:2.2.0:compile 
     | +- commons-dbcp:commons-dbcp:jar:1.2.2:compile 
     | | \- commons-pool:commons-pool:jar:1.3:compile 
     | +- org.directwebremoting:dwr:jar:2.0.1:compile 
     | +- javax.servlet:jstl:jar:1.1.2:compile 
     | +- taglibs:standard:jar:1.1.2:compile 
     | +- opensymphony:oscache:jar:2.3:compile 
     | +- opensymphony:sitemesh:jar:2.2.1:compile 
     | +- org.tuckey:urlrewritefilter:jar:3.0.4:compile 
     | \- commons-lang:commons-lang:jar:2.4:compile 

그래서 우리는 이것이 가능한지 확인해야합니다. 이것은 WEB-INF/lib/*의 packagingExclude를 변경하여 모든 것을 제외시키지 않고 유지하고자하는 것을 제외한 모든 것을 제외하도록 할 수 있습니다.

이 방법으로 수행 할 수 있습니다

 <packagingExcludes> 
     %regex[WEB-INF/lib/(?!clickstream|struts|appfuse|commons-fileupload|commons-dbcp|dwr|oscache|sitemesh|urlrewritefilter|commons-lang|velocity|xwork|commons-digester).*.jar] 
     </packagingExcludes> 

이 발견되지 않는 클래스에 대해 불평 글래스 피쉬 정지를 만들 것입니다. 나는 아직 거기에 있지 않다. 그래서 더 많은 항아리들을 포함 할 필요가 있을지 모르지만, 점점 더 가까워지고있다. | 스트럿 | |의 AppFuse | 평민 - 파일 업로드 | 평민 - DBCP | DWR | OSCACHE |이 SiteMesh % 정규식 [WEB-INF/lib 디렉토리/(?! 클릭 스트림 : 모든 작업을 한 후에

+0

내 전체 packagingExcludes - 정규식은 다음과 같다 urlrewritefilter | commons-lang | velocity | xwork | commons-digester | xfire | xbean | ognl | freemarker | activemq). *. jar] – Tobb