0

我正在尝试使用 Maven 构建项目,但出现此错误:

[INFO] --- aspectj-maven-plugin:1.4:compile (default) @ core ---
[ERROR] ABORT
[ERROR] AspectJ 1.6.1 ran out of memory during compilation:

Please increase the memory available to ajc by editing the ajc script 
found in your AspectJ installation directory. The -Xmx parameter value
should be increased from 64M (default) to 128M or even 256M.

我尝试了 configure aspectj-maven-plugin in pom.xml,但没有任何效果:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.4</version>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjrt</artifactId>
                    <version>1.6.1</version>
                </dependency>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjtools</artifactId>
                    <version>1.6.1</version>
                </dependency>
            </dependencies>
            <configuration>
                <argLine>-Xmx1024m</argLine>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

我的本地副本工作正常,此错误仅在部署中发生。如何修复?

4

2 回答 2

2

export MAVEN_OPTS="-Xmx2048m -XX:MaxPermSize=512m"

进入构建脚本解决了这个问题。(我尝试使用1024m)

于 2013-12-24T21:16:50.710 回答
0

我似乎在插件手册中找不到任何内存使用选项。也许您应该按照建议进行操作并手动更改本地安装目录中的 ajc 脚本(尽管我必须承认这似乎是一个糟糕的解决方案)

于 2013-12-24T17:03:55.017 回答