Maven 未能 assemble WAR - Java 堆 Space 问题 - Stanford Core NLP
Maven failing to assemble WAR - Java Heap Space Issue - Stanford Core NLP
所以我在尝试使用 Maven 进行全新安装时遇到此错误。我尝试用 Xmx-512m 或 w/e 增加 MAVEN_OPTS 它被调用,类似地摆弄 Eclipse ini 来增加堆 space,但所有这些都无济于事,我一直得到这个错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DiaryAppREST 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ DiaryAppREST ---
[INFO] Deleting C:\Users\Administrator\workspace\DiaryAppREST\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ DiaryAppREST ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Administrator\workspace\DiaryAppREST\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ DiaryAppREST ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ DiaryAppREST ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:3.0.0:war (default-war) @ DiaryAppREST ---
[INFO] Packaging webapp
[INFO] Assembling webapp [DiaryAppREST] in [C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Administrator\workspace\DiaryAppREST\WebContent]
[INFO] Webapp assembled in [8913 msecs]
[INFO] Building war: C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.019 s
[INFO] Finished at: 2017-02-28T09:52:30+00:00
[INFO] Final Memory: 86M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project DiaryAppREST: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]
[ERROR]
我不明白是什么原因造成的,尝试在网上查找信息,但似乎找不到其他人遇到的这个具体问题。如果有人能够提供帮助,我将不胜感激。
刚弄明白,
首先,我把MAVEN_OPTS设置错了,我把它们设置成:
set MAVEN_OPTS="Xmx 512m"
将其更改为:
set MAVEN_OPTS="-Xmx512m"
您还可以将此行添加到您的配置文件(.profile、.bash_profile 等)中,以便在您打开的每个终端中进行设置。
export MAVEN_OPTS="-Xmx512m"
然后使用CMD进入项目所在的目录,
我运行:
mvn clean install -U
这似乎成功了,一切顺利。
希望这对遇到问题的其他人有所帮助!
我在 Windows 盒子上通过 Jenkins 的 ant 遇到了同样的问题 运行 maven。
问题是如何传递内存参数。这是更新后的 ant 脚本,显示如何传递参数“<jvmarg value="-Xmx1024m" />
”:
<target name="web.package" depends="init" if="warName">
<artifact:mvn mavenHome="${maven.home}" failonerror="true" fork="true">
<jvmarg value="-Dmaven.multiModuleProjectDirectory=$M2_HOME" />
<jvmarg value="-Xmx1024m" />
<arg value="package" />
<arg value="-Pwar" />
<arg value="-DwarName=${warName}" />
<arg value="-Denv=${env}" />
<arg value="-e" />
</artifact:mvn>
</target>
有关信息,这里是崩溃输出:
[artifact:mvn] [INFO] Building war: D:\Jenkins\workspace\DEPLOY_SVN\atl_dev_trunk\src\tomcat\target\abc##6_4_6_0.war
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] BUILD FAILURE
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Total time: 01:50 min
[artifact:mvn] [INFO] Finished at: 2017-11-09T02:35:50+01:00
[artifact:mvn] [INFO] Final Memory: 99M/247M
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project abc: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]
所以我在尝试使用 Maven 进行全新安装时遇到此错误。我尝试用 Xmx-512m 或 w/e 增加 MAVEN_OPTS 它被调用,类似地摆弄 Eclipse ini 来增加堆 space,但所有这些都无济于事,我一直得到这个错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DiaryAppREST 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ DiaryAppREST ---
[INFO] Deleting C:\Users\Administrator\workspace\DiaryAppREST\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ DiaryAppREST ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Administrator\workspace\DiaryAppREST\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ DiaryAppREST ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Administrator\workspace\DiaryAppREST\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ DiaryAppREST ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ DiaryAppREST ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:3.0.0:war (default-war) @ DiaryAppREST ---
[INFO] Packaging webapp
[INFO] Assembling webapp [DiaryAppREST] in [C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\Administrator\workspace\DiaryAppREST\WebContent]
[INFO] Webapp assembled in [8913 msecs]
[INFO] Building war: C:\Users\Administrator\workspace\DiaryAppREST\target\DiaryAppREST-0.0.1-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.019 s
[INFO] Finished at: 2017-02-28T09:52:30+00:00
[INFO] Final Memory: 86M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project DiaryAppREST: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]
[ERROR]
我不明白是什么原因造成的,尝试在网上查找信息,但似乎找不到其他人遇到的这个具体问题。如果有人能够提供帮助,我将不胜感激。
刚弄明白,
首先,我把MAVEN_OPTS设置错了,我把它们设置成:
set MAVEN_OPTS="Xmx 512m"
将其更改为:
set MAVEN_OPTS="-Xmx512m"
您还可以将此行添加到您的配置文件(.profile、.bash_profile 等)中,以便在您打开的每个终端中进行设置。
export MAVEN_OPTS="-Xmx512m"
然后使用CMD进入项目所在的目录, 我运行:
mvn clean install -U
这似乎成功了,一切顺利。
希望这对遇到问题的其他人有所帮助!
我在 Windows 盒子上通过 Jenkins 的 ant 遇到了同样的问题 运行 maven。
问题是如何传递内存参数。这是更新后的 ant 脚本,显示如何传递参数“<jvmarg value="-Xmx1024m" />
”:
<target name="web.package" depends="init" if="warName">
<artifact:mvn mavenHome="${maven.home}" failonerror="true" fork="true">
<jvmarg value="-Dmaven.multiModuleProjectDirectory=$M2_HOME" />
<jvmarg value="-Xmx1024m" />
<arg value="package" />
<arg value="-Pwar" />
<arg value="-DwarName=${warName}" />
<arg value="-Denv=${env}" />
<arg value="-e" />
</artifact:mvn>
</target>
有关信息,这里是崩溃输出:
[artifact:mvn] [INFO] Building war: D:\Jenkins\workspace\DEPLOY_SVN\atl_dev_trunk\src\tomcat\target\abc##6_4_6_0.war
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] BUILD FAILURE
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [INFO] Total time: 01:50 min
[artifact:mvn] [INFO] Finished at: 2017-11-09T02:35:50+01:00
[artifact:mvn] [INFO] Final Memory: 99M/247M
[artifact:mvn] [INFO] ------------------------------------------------------------------------
[artifact:mvn] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.0.0:war (default-war) on project abc: Error assembling WAR: Problem creating war: Execution exception (and the archive is probably corrupt but I could not delete it): Java heap space -> [Help 1]