使用flex-plugin部署Java堆空间

时间:2011-04-11 16:13:29

标签: java flex maven-3

我在maven有一个flex项目。 我可以毫无问题地打包和安装它,但我无法部署它:

[ERROR] Java heap space -> [Help 1]
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2734)
        at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
        at java.util.ArrayList.addAll(ArrayList.java:474)
        at org.apache.maven.project.MavenProject.setActiveProfiles(MavenProject.java:1410)
        at org.apache.maven.project.MavenProject.deepCopy(MavenProject.java:1961)

我已经增加了最大分配内存(设置为MAVEN_OPTS = -Xms2512m -Xmx3512m),但没有成功。

这是我的pom:

<parent>
    <groupId>com.test</groupId>
    <artifactId>super-pom</artifactId>
    <version>1.2</version>
</parent>

<artifactId>services</artifactId>

<name>Services</name>
<packaging>swc</packaging>

<properties>
    <flex.version>4.1.0.16076</flex.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.servebox.flex</groupId>
            <artifactId>flex-plugin</artifactId>
            <version>3.0.0-beta5</version>
            <extensions>true</extensions>

            <configuration>
                <locale>en_US</locale>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                    <version>2.8.1</version>
                </dependency>
            </dependencies>
        </plugin>

    </plugins>
</build>

<dependency> 
    <groupId>com.adobe.flash.core</groupId> 
    <artifactId>playerglobal</artifactId> 
    <version>2.0</version> 
    <scope>provided</scope> 
    <type>swc</type> 
</dependency> 
<dependency> 
    <groupId>com.adobe.flex.sdkcore</groupId> 
    <artifactId>framework</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency> 
<dependency> 
    <groupId>com.adobe.flex.sdkcore</groupId> 
    <artifactId>flex</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency>  
<dependency> 
    <groupId>com.adobe.flex.sdkcore</groupId> 
    <artifactId>rpc</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency> 
<dependency> 
    <groupId>com.adobe.flex.sdkcore</groupId> 
    <artifactId>spark</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency> 
<dependency> 
    <groupId>com.adobe.flex.sdkcore</groupId> 
    <artifactId>utilities</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency>
<!-- LOCALE -->
<dependency>
    <groupId>com.adobe.flex.locales.en_US</groupId> 
    <artifactId>framework_rb</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency> 
<dependency>
    <groupId>com.adobe.flex.locales.en_US</groupId> 
    <artifactId>rpc_rb</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency>
<dependency>
    <groupId>com.adobe.flex.locales.en_US</groupId> 
    <artifactId>spark_rb</artifactId> 
    <version>${flex.version}</version> 
    <type>swc</type> 
</dependency>

“mvn package”运行正常。 “mvn install”运行正常。 “mvn deploy”失败,上面有例外。

有什么问题?

1 个答案:

答案 0 :(得分:0)

对于maven和Java而言,这是太多的内存。您的计算机内存确实耗尽了内存。设置为Xmx1024m和Xms512m。对于你想要完成的事情来说应该足够了。此外,如果要使用Maven编译Flex,则应考虑使用FlexMojos