2013-08-15 2 views
3

길고도 짧은 이야기, 내가 사용하는 경우 잘 실행 받는다는 프로젝트가 :고정 받는다는 Java 힙 공간 오류

export MAVEN_OPTS=-Xmx1024m 

을하지만, 그것없이 내가 얻을 :

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ project --- 

... 

An annotation processor threw an uncaught exception. 
Consult the following stack trace for details. 
java.lang.OutOfMemoryError: Java heap space 

지금 내가하고 싶습니다 해당 구성을 pom 파일로 이동하십시오. 나는 두 가지 가능성을 시도 :이의

<plugin> 
    <artifactId>maven-compiler-plugin</artifactId> 
    <version>3.1</version> 
    <configuration> 
     <meminitial>512m</meminitial> 
     <maxmem>2048m</maxmem> 
     <source>1.6</source> 
     <target>1.6</target> 
    </configuration> 
</plugin> 

... 

<plugin> 
    <artifactId>maven-compiler-plugin</artifactId> 
    <version>3.1</version> 
    <configuration> 
     <argLine>-Xmx1024m</argLine> 
     <source>1.6</source> 
     <target>1.6</target> 
    </configuration> 
</plugin> 

없음 작동하지 않습니다.

-Xmx 매개 변수를 pom 파일에서 처리하는 다른 방법이 있습니까?

답변

4

현재 실행중인 프로세스의 메모리 설정에 영향을주지 않으므로 구성에 <fork>true</fork>을 사용해야합니다.