2012-06-22 39 views
2

更新一戰裏面清單我需要更新戰爭的META-INF.MF文件如何與Maven

問題是

取決於其他戰爭文件我的戰爭文件,這取決於其他war文件

結構的樣子: -

web.war 
     on top of web.war created Client.war (Customization ) 
      on top of Client.war created lite.war 

在web.war中包含META-INF使用默認屬性

While generating Client.war i got META_INF from web.war 
...... 

lite.war包含它自己的META-INF,但它是由基地戰爭重寫

Maven的CONSLE輸出: -

[INFO] Processing war project 
    [INFO] Copying webapp resources [**********/trunk/src/lite/src/main/webapp] 
    [DEBUG] + META-INF/MANIFEST.MF has been copied. 
    [DEBUG] + WEB-INF/web.xml has been copied. 
    [DEBUG] + WEB-INF/jboss-app.xml has been copied. 
    [DEBUG] + WEB-INF/web-2.5.xml has been copied. 
    [DEBUG] + WEB-INF/jboss_classloading.txt has been copied. 
    . 
    . 
    [DEBUG] + index.jasp has been copied. 
    [DEBUG] + WEB-INF/classes/org/wtc/web/board/Myboard.class has been copied. 

    .......... 

    [INFO] Processing overlay [ id wtc.eagle:Client] 
    [DEBUG] Expanding:******/.m2/repository2/wtc/eagle/Client/2.0/Client-2.0.war into********/trunk/src/lite/target/war/work/wtc.eagle/Client 
    [DEBUG] ********/trunk/src/lite/target/war/work/wtc.eagle/Client/META-INF/maven/wtc.eagle/Client/pom.properties: mode 100664, chmod 664 
    [DEBUG] ********/trunk/src/lite/target/war/work/wtc.eagle/Client/META-INF/maven/wtc.eagle/Client/pom.xml: mode 100664, chmod 664 
    . 
    ..... 
    [INFO] Webapp assembled in [7854 msecs] 
    [DEBUG] Excluding [] from the generated webapp archive. 
    [DEBUG] Including [**] in the generated webapp archive. 
    [INFO] Building war: ******/trunk/src/lite/target/Lite-1.0.war 
    [DEBUG] adding directory META-INF/ 
    [DEBUG] adding entry META-INF/MANIFEST.MF 

能否請你幫我如何重寫META-INF文件在lite.war

在此先感謝...

的pom.xml: -

 <?xml version="1.0" encoding="UTF-8"?> 
     <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> 
    <parent> 
     <artifactId>eaglerplite</artifactId> 
     <groupId>com.wtc.eaglerp</groupId> 
     <version>1.0</version> 
    </parent> 
<groupId>com.wtc.eaglerp</groupId> 
<artifactId>lite</artifactId> 
<packaging>war</packaging> 
<version>1.0</version> 

<name>LIte </name> 
    <url>http://javate.sourceforge.net</url> 
<dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
       <groupId>commons-logging</groupId> 
       <artifactId>commons-logging</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>commons-io</groupId> 
       <artifactId>commons-io</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zk</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zkplus</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zul</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zhtml</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zkex</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zk</groupId> 
       <artifactId>zkmax</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.common</groupId> 
       <artifactId>zcommon</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.common</groupId> 
       <artifactId>zweb</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.zkoss.zkforge.el</groupId> 
       <artifactId>zcommons-el</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>commons-lang</groupId> 
       <artifactId>commons-lang</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.beanshell</groupId> 
       <artifactId>bsh</artifactId> 
     </dependency> 
     <dependency> 
       <groupId>org.codehaus.groovy</groupId> 
       <artifactId>groovy-all</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.jruby</groupId> 
       <artifactId>jruby</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>org.python</groupId> 
       <artifactId>jython</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>rhino</groupId> 
       <artifactId>js</artifactId> 
       <scope>provided</scope> 
     </dependency> 
     <dependency> 
       <groupId>net.sf.jasperreports</groupId> 
       <artifactId>jasperreports</artifactId> 
       <scope>provided</scope> 
     </dependency> 
<dependency> 
    <groupId>wtc.eagle</groupId> 
    <artifactId>Client</artifactId> 
    <version>2.0</version> 
    <type>war</type> 
    <scope>compile</scope> 
</dependency> 
<dependency> 
    <groupId>eagle</groupId> 
    <artifactId>webui</artifactId> 
    <version>360</version> 
    <type>jar</type> 
    <scope>provided</scope> 
</dependency> 
<dependency> 
    <groupId>com.wtc.eaglerp</groupId> 
    <artifactId>baselite</artifactId> 
    <version>1.0</version> 
    <type>jar</type> 
    <scope>compile</scope> 
</dependency> 
<dependency> 
<groupId>eagle</groupId> 
<artifactId>timelinez</artifactId> 
<version>1.0</version> 
</dependency> 
<dependency> 
    <groupId>eagle.theme</groupId> 
    <artifactId>Pistacho</artifactId> 
    <version>2.0</version> 
</dependency> 
    </dependencies> 
<build> 
     <finalName>Lite-1.0</finalName> 
     <sourceDirectory>${basedir}/src/main/webapp/WEB-INF/src/</sourceDirectory> 
     <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory> 
    <plugins> 
    <plugin> 
       <artifactId>maven-war-plugin</artifactId> 
       <configuration> 
        <webResources> 
         <webResource> 
          <directory>src/main/webapp</directory> 
          <filtering>true</filtering> 
          <includes> 
      <!--     <include>META-INF/**</include> --> 
           <include>META-INF/MANIFEST.MF</include> 
      <!--     <include>WEB-INF/web.xml</include> --> 
          </includes> 
         </webResource> 
         <webResource> 
           <directory>${basedir}/src/main/webapp</directory> 
          </webResource> 
        </webResources> 
       </configuration> 
      </plugin> 
    </plugins> 
</build> 
</project> 

回答

0

嘗試下面的配置,在pom.xml中添加該配置

<plugin> 
       <artifactId>maven-war-plugin</artifactId> 
       <configuration> 
        <webResources> 
         <webResource> 
          <directory>src/main/webapp</directory> 
          <filtering>true</filtering> 
          <includes> 
           <include>META-INF/MANIFEST.MF</include> 
           <include>META-INF/context.xml</include> 
           <include>WEB-INF/web.xml</include> 
          </includes> 
         </webResource> 
         <webResource> 
          <directory>../projectname-webapp</directory> 
         </webResource> 
        </webResources> 
       </configuration> 
      </plugin> 
+0

感謝快速重播 我將此變化,但它不會給預期的結果。仍然我得到老戰爭MANIFEST.MF – Giri

+0

你能分享你的pom.xml –

+0

我分享了我的pom.xml(在最後一個問題) – Giri