在Eclipse工作区中创建项目的无头构建设置。
基本上这就是它的工作方式
所有工作正常 - 除了通过eclipse ant任务构建 - 在大约50次执行后运行到OutOfMemoryError。
注意:自动构建会一直失败 - 直到在该工作区上打开Eclipse并关闭。 此后再次运行50次构建,然后OutOfMemoryError。
在Ant文件中构建工作区任务
<target name="build_workspace">
<echo message="building workspace" />
<eclipse.incrementalBuild kind="full"/>
</target>
还尝试了kind = clean和incremental,但是同样的错误。
<target name="build_workspace">
<echo message="building workspace" />
<eclipse.incrementalBuild kind="clean"/>
<eclipse.incrementalBuild kind="incremental"/>
</target>
看起来像在工作区中堆积的东西,在该工作区上打开Eclipse时会被清理/纠正。
请提出一些解决方案/指示。
以下是构建失败的样子 -
build_workspace:
[echo] building workspace
BUILD FAILED
C:\Users\US\.jenkins\workspace\XBrowseReleaseBranchTests\testrunscripts\runtests.xml:51: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
at java.lang.StringBuilder.append(StringBuilder.java:119)
at java.lang.Throwable.toString(Throwable.java:344)
at java.lang.String.valueOf(String.java:2826)
at java.io.PrintWriter.println(PrintWriter.java:710)
at java.lang.Throwable.printStackTrace(Throwable.java:509)
at org.eclipse.jdt.internal.compiler.util.Util.getExceptionSummary(Util.java:627)
at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:589)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:524)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:365)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:302)
at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:422)
at org.eclipse.core.resources.ant.IncrementalBuild.execute(IncrementalBuild.java:75)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)