每个Maven构建都会增加WAR文件的大小

时间:2014-11-19 05:38:06

标签: java build maven-2 war

我正在使用maven构建一个war文件,每次构建它时,无论是否有任何更改,war文件的大小都会增加。我正在使用clean prepare-package install在构建war时。

之前构建时间successful,但目前war的大小约为4GB,在构建时我收到以下错误:Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: invalid entry size -> [Help 1]

这是pom.xml

<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>org.bio</groupId>
<artifactId>ibbl_jasper_war</artifactId>
<packaging>war</packaging>
<version>3.7</version>
<name>IBBL Jasper War file</name>
<scm>
    <connection>scm:svn:http://luxsvn.tgen.org/misc/jasperserver-ce-3.7.0-bin/jasperserver_war/trunk</connection>
    <developerConnection>scm:svn:http://luxsvn.tgen.org/misc/jasperserver-ce-3.7.0-bin/jasperserver_war/trunk</developerConnection>
    <url>http://luxsvn.tgen.org</url>
</scm>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <bio4dVersion>1.1.7-SNAPSHOT</bio4dVersion>
</properties>
<dependencies>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_common_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_security_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_reports_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_administration_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_bms_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_eai_jar</artifactId>
        <version>${bio4dVersion}</version>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_workflow_jar</artifactId>
        <version>${bio4dVersion}</version>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_lims_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_cims_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_sms_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_rpms_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_dynaforms_jar</artifactId>
        <version>${bio4dVersion}</version>
        <scope>provided</scope>
    </dependency>
    <!-- <dependency>
        <groupId>org.bio</groupId>
        <artifactId>ibbl_audit_jar</artifactId>
        <version>1.0.0</version>
    </dependency> -->
    <dependency>
        <groupId>org.bio</groupId>
        <artifactId>core_audit_jar</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.7.4</version>
    </dependency>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.7.4</version>
    </dependency>
    <dependency>
        <groupId>org.docx4j</groupId>
        <artifactId>docx4j</artifactId>
        <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ibatis</groupId>
        <artifactId>ibatis-sqlmap</artifactId>
        <version>2.3.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>net.sf.barcode4j</groupId>
        <artifactId>barcode4j</artifactId>
        <version>2.0</version>
    </dependency>
    <dependency>
        <groupId>jcs</groupId>
        <artifactId>jcs</artifactId>
        <version>1.3</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jasypt</groupId>
        <artifactId>jasypt</artifactId>
        <version>1.5</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.ibm.icu</groupId>
        <artifactId>icu4j</artifactId>
        <version>3.8</version>
    </dependency>
    <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis-ext</artifactId>
        <version>1.3.04</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-css</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-ext</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-xml</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-parser</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-all</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-bridge</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-svggen</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-dom</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-svg-dom</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-gvt</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>batik</groupId>
        <artifactId>batik-util</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <version>2.4</version>
        <classifier>jdk15</classifier>
    </dependency>
</dependencies>
<build>
    <plugins>
        <!-- DEPENDECY PLugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <excludeTransitive>true</excludeTransitive>
                        <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <!-- WAR PLugin -->
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <outputDirectory>${artifactsDir}/</outputDirectory>
                    <warName>ibbl_jasperserver37_war</warName>
                    <webXml>WEB-INF/web.xml</webXml>
                    <warSourceDirectory>${project.file.parentFile.parent}/ibbl_jasperserver_war/</warSourceDirectory>
                    <warSourceExcludes>WEB-INF/lib/jta*.jar</warSourceExcludes>
                    <webResources>
                        <resource>
                            <directory>${project.file.parentFile.parent}/ibbl_jasperserver_war/</directory>
                            <filtering>true</filtering>
                            <includes>
                                <include>**/hibernate.properties</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <!-- deploy war to JBOSS -->

            <!-- deploy war to JBOSS -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jboss-maven-plugin</artifactId>
                <!-- Custom Plugin for JBOSS (plugin source modified by Phani) -->
                <version>custom</version>
                <executions>
                    <execution>
                        <id>deploy-war</id>
                        <phase>install</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <inherited>false</inherited>
                        <configuration>
                            <!-- set JBOSS_HOME in env path -->
                            <jbossHome>${JBOSS_HOME}</jbossHome>
                            <!-- set JBOSS_SERVER in env path -->
                            <serverName>${JBOSS_SERVER}</serverName>
                            <!-- set JBOSS_HOST in env path -->
                            <hostName>${JBOSS_HOST}</hostName>
                            <!-- set JBOSS_PORT in env path -->
                            <port>${JBOSS_PORT}</port>
                            <!-- set to check if the deployable file is war or ear -->
                            <checkDeployFileURL>${JBOSS_DEPLOY_FILE_URL}</checkDeployFileURL>
                            <!-- pass the deployable files to deploy mojo -->
                            <!-- if DEPLOY FILE_URL starts with "explode:///" protocol for e.g. 
                                explode:///c:/work/artifacts/ibbl_imc_war.war, then this plugin will explode 
                                the file in jboss server folder -->
                            <!-- explodeIncludeJars>ibbl</explodeIncludeJars -->
                            <fileNames>
                                <param>${JBOSS_DEPLOY_FILE_URL}</param>
                            </fileNames>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
    </plugins>
</build>

0 个答案:

没有答案