سؤال

I'm trying to build project with Maven, but I'm getting this error:

[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.

I tried configure aspectj-maven-plugin in pom.xml, but it doesn't take any effect:

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

My local copy works fine, this error happens only in deployment. How it can be fixed?

هل كانت مفيدة؟

المحلول

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

into the build script solved the problem. (I tried to use 1024m)

نصائح أخرى

I can't seem to find any memory usage options in the plugin manual. Maybe you should do as it suggests and manually change the ajc script in your local installation directory (although I must admit it seems a poor solution)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top