2

我需要更新战争的 META-INF.MF 文件

问题是

我的战争文件取决于其他战争文件,即取决于另一个战争文件

结构看起来像: -

    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 控制台输出:-

    [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

你能帮我如何覆盖 lite.war 中的 META-INF 文件吗

提前致谢...

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>
4

1 回答 1

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>
于 2012-06-22T05:56:27.443 回答