2011-10-18 4 views
0

maven에서 빌드 한 .war 파일에 문제가 있습니다.maven에서 변경된 pom 파일을 고려하지 않음

제공된 범위가있는 프로젝트의 POM에 대한 의존성이 있습니다.

처음으로 내 프로젝트에서 "패키지"목표를 실행하려고 할 때, maven은 종속 jar 파일을 최종 .war 파일에 삽입하지 않습니다.

그리고 내가 예상 한대로 POM에서 제공된 범위 형식을 제거하면 maven에 종속 된 최종 .war 파일의 jar 파일 (이 시점까지는 정확함)이 포함됩니다.

그러나 종속성에 대한 제공된 범위를 다시 설정하면 maven은 여전히 ​​war 패키지에 종속 jar 파일을 포함합니다.

나는 깨끗한 : 깨끗한 목표를 시도했으며 또한 스냅 샷 스위치 을 업데이트했지만 여전히 잘못되었습니다.

버그입니까? 아니면 이것을 피하기 위해 몇 가지 구성을해야합니다.

내가 받는다는 3.0.3

을 사용하고이는 POM :

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>testmaven</groupId> 
    <artifactId>testmaven</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>war</packaging> 
    <name/> 
    <description/> 
    <dependencies> 
    <dependency> 
      <groupId>com.pardis.communicationcenter</groupId> 
      <artifactId>communicationCenterCommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.communicationcenter</groupId> 
      <artifactId>communicationCenterWSCommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.parameterengine</groupId> 
      <artifactId>parameterenginecommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
      <dependency> 
      <groupId>com.bea.weblogic</groupId> 
      <artifactId>weblogic</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.thoughtworks.xstream</groupId> 
      <artifactId>xstream</artifactId> 
      <version>1.3.1</version> 
     </dependency> 

     <dependency> 
      <groupId>javaee</groupId> 
      <artifactId>javaee-api</artifactId> 
      <scope>provided</scope> 
      <version>5</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.velocity</groupId> 
      <artifactId>velocity</artifactId> 
      <version>1.5</version> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.common</groupId> 
      <artifactId>fanavaCommon</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.retail.common</groupId> 
      <artifactId>rtlmgrCommon</artifactId> 
      <version>1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>com.pardis.retail.common</groupId> 
      <artifactId>rtlmgrFast</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.job</groupId> 
      <artifactId>jobschedulingclient</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.security</groupId> 
      <artifactId>pincoding</artifactId> 
      <version>1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>com.pardis.workflowengine</groupId> 
      <artifactId>workflowenginegclient</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 

     <dependency> 
      <groupId>com.pardis.genericmanagedbean</groupId> 
      <artifactId>genericManagedBeanCommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.myfaces.tomahawk</groupId> 
      <artifactId>tomahawk</artifactId> 
      <version>1.1.9</version> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.common</groupId> 
      <artifactId>SAD</artifactId> 
      <version>1.6</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.common</groupId> 
      <artifactId>accountDataProviderCommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.common</groupId> 
      <artifactId>personDataProviderCommon</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
     </dependency> 
     <dependency> 
      <groupId>com.pardis.bank</groupId> 
      <artifactId>BankBusiness</artifactId> 
      <version>1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.myfaces.core</groupId> 
      <artifactId>myfaces-impl</artifactId> 
      <version>1.2.7</version> 
     </dependency> 

     <dependency> 
      <groupId>com.pardis.batch</groupId> 
      <artifactId>batchwebserviceclient</artifactId> 
      <version>1.0</version> 
     </dependency> 

<dependency> 
    <groupId>com.pardis.security</groupId> 
    <artifactId>usermanagerclient</artifactId> 
    <version>1.0</version> 
    <type>jar</type> 
</dependency> 

<dependency> 
    <groupId>com.pardis.cardmanager</groupId> 
    <artifactId>crdmgrCommon</artifactId> 
    <version>1.0</version> 
</dependency> 
    </dependencies> 
    <build> 
    <sourceDirectory>${basedir}/src</sourceDirectory> 
    <outputDirectory>${basedir}/WebRoot/WEB-INF/classes</outputDirectory> 
    <resources> 
     <resource> 
     <directory>${basedir}/src</directory> 
     <excludes> 
      <exclude>**/*.java</exclude> 
     </excludes> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
     <artifactId>maven-war-plugin</artifactId> 
     <configuration> 
      <webappDirectory>${basedir}/WebRoot</webappDirectory> 
      <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory> 
     </configuration> 
     </plugin> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

문제가 약 : 사전에

 <dependency> 
      <groupId>com.bea.weblogic</groupId> 
      <artifactId>weblogic</artifactId> 
      <version>1.0</version> 
      <type>jar</type> 
      <scope>provided</scope> 
     </dependency> 

감사

답변

1

어떤 전쟁을하다 보고있어? mvn clean package을 실행하면 대상 디렉토리에 새로운 전쟁이 생기며 그 전쟁은 범위가 provided 인 종속 관계가 없습니다.

+0

테스트를 거쳤으나 문제가 해결되지 않았습니다. – arash

+0

다른 종속성을 제거하고 패키지 목표를 다시 실행해도 maven은 여전히 ​​모든 종속 jar 파일을 전쟁 아카이브에 저장합니다! 그게 뭐가 잘못 됐니? – arash

+0

파일의 실제 경로가 바뀌면 모든 것이 정상적으로 처리됩니다! – arash

관련 문제