Java 如何增加aspectj maven插件';内存限制
我正在尝试使用Maven构建项目,但遇到以下错误:Java 如何增加aspectj maven插件';内存限制,java,maven,aspectj,aspectj-maven-plugin,Java,Maven,Aspectj,Aspectj Maven Plugin,我正在尝试使用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
[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.
我尝试在pom.xml
中配置aspectj maven插件,但没有任何效果:
<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>
org.codehaus.mojo
aspectj maven插件
1.4
org.aspectj
aspectjrt
1.6.1
org.aspectj
aspectjtools
1.6.1
-Xmx1024m
1.6
1.6
UTF-8
编译
我的本地副本工作正常,此错误仅在部署时发生。如何修复它?在插件手册中,我似乎找不到任何内存使用选项。也许您应该按照它的建议,手动更改本地安装目录中的ajc脚本(尽管我必须承认这似乎是一个糟糕的解决方案)
export-MAVEN\u OPTS=“-Xmx2048m-XX:MaxPermSize=512m”
在构建脚本中解决了这个问题。(我尝试使用1024m)我没有看到aspectj maven插件的
argLine
设置。我猜您必须设置MAVEN_OPTS
environment var才能解决此问题。@AndrewLogvinov在运行重建脚本之前试图执行export MAVEN_OPTS=“-Xmx1024m”
,但这无助于我在哪里可以找到此本地安装目录?我不记得安装了aspectJ,我只能在.m2回购中找到它作为jar