maven mvn実行エラー
2726 ワード
今日buildGlassFishソースでエラーが発生しました.その後、mvnの後に-Xを追加し、詳細を印刷します.
次の理由で、対応するwikiページに移動します.
1. You are building a very big multi-module project, each module requires a certain amount of memory so with increasing number of modules the amount of required memory increases as well until the JVM finally runs out of "Java heap space".
2. You are using some plugins that perform memory-intensive operations like analyzing the class files of all project dependencies.
3. You are using the Maven Compiler Plugin with the option fork=false (default) and your project has a lot of source files to compile. When using the Java compiler in embedded mode, each compiled class will consume heap memory and depending on the JDK being used this memory is not subject to gargabe collection, i.e. the memory allocated for the compiled classes will not be freed. The resultant error message typically says "PermGen space".
Fixing this error is usually just a matter of assigning more memory to the JVM. If you run from the command line, this can be done by means of the environment variable MAVEN_OPTS. This variable can be used to specify options for the JVM itself. In case of "Java heap space", the option of interest is -Xmx, in case of "PermGen space"it's usually -XX:MaxPermSize. For example, on Windows you would use
set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m
設定後、mvnを再度実行します.正常に実行された可能性があります.
[INFO] Scanning for projects...
[ERROR] Java heap space -> [Help 1]
java.lang.OutOfMemoryError: Java heap space
at org.apache.maven.model.Dependency.clone(Dependency.java:204)
at org.apache.maven.model.DependencyManagement.clone(DependencyManagemen
t.java:67)
at org.apache.maven.model.ModelBase.clone(ModelBase.java:190)
at org.apache.maven.model.Model.clone(Model.java:260)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode
lBuilder.java:279)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultMode
lBuilder.java:232)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:410)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:379)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBu
ilder.java:495)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryErr
or
次の理由で、対応するwikiページに移動します.
1. You are building a very big multi-module project, each module requires a certain amount of memory so with increasing number of modules the amount of required memory increases as well until the JVM finally runs out of "Java heap space".
2. You are using some plugins that perform memory-intensive operations like analyzing the class files of all project dependencies.
3. You are using the Maven Compiler Plugin with the option fork=false (default) and your project has a lot of source files to compile. When using the Java compiler in embedded mode, each compiled class will consume heap memory and depending on the JDK being used this memory is not subject to gargabe collection, i.e. the memory allocated for the compiled classes will not be freed. The resultant error message typically says "PermGen space".
Fixing this error is usually just a matter of assigning more memory to the JVM. If you run from the command line, this can be done by means of the environment variable MAVEN_OPTS. This variable can be used to specify options for the JVM itself. In case of "Java heap space", the option of interest is -Xmx, in case of "PermGen space"it's usually -XX:MaxPermSize. For example, on Windows you would use
set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m
設定後、mvnを再度実行します.正常に実行された可能性があります.