【问题标题】:Unknown compilation error in maven compileMaven编译中的未知编译错误
【发布时间】:2018-06-19 14:21:50
【问题描述】:

我正在尝试使用 maven 编译器插件 (3.7) 编译我的代码,但我不断收到未知的编译错误,并且在编译过程中系统资源不足,请查看下面的错误日志。该日志无助于定位编译问题,因为该项目的规模非常大。在我们将一些功能合并到这个分支之前,它之前运行良好,我检查了 pom.xml 并且依赖项没有问题,并且项目在开发期间在 eclipse 中运行良好。

exec] INFO: Changing method name from isSubstitue to getSubstitue
 [exec] [INFO]
 [exec] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ siemops ---
 [exec] [INFO] Using 'UTF-8' encoding to copy filtered resources.
 [exec] [INFO] Copying 26 resources
 [exec] [INFO]
 [exec] [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ siemops ---
 [exec] [INFO] Changes detected - recompiling the module!
 [exec] [INFO] Compiling 1106 source files to C:\workspace\prj\target\classes
 [exec]
 [exec]
 [exec] The system is out of resources.
 [exec] Consult the following stack trace for details.
 [exec] java.lang.StackOverflowError
 [exec]     at com.sun.tools.javac.code.Types$Rewriter.visitClassType(Types.java:4289)
 [exec]     at com.sun.tools.javac.code.Types$Rewriter.visitClassType(Types.java:4275)
 [exec]     at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:778)
 [exec]     at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:4532)
 [exec]     at com.sun.tools.javac.code.Types$Rewriter.visitTypeVar(Types.java:4322)
 [exec]     at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:4532)
 [exec] [INFO] -------------------------------------------------------------
 [exec] [ERROR] COMPILATION ERROR :
 [exec] [INFO] -------------------------------------------------------------
 [exec] [ERROR] An unknown compilation problem occurred
 [exec] [INFO] 1 error
 [exec] [INFO] -------------------------------------------------------------

【问题讨论】:

标签: java maven


【解决方案1】:

试试

MAVEN_OPTS=-Xms256m -Xmx1024m -Xss1024k

Xss:应根据可用的硬件进行设置。

它会增加堆内存。

或者

您的应用程序中可能存在递归方法调用,它正在利用整个堆内存。你需要避免它

【讨论】:

  • 这个问题是关于编译的,递归方法调用永远不会编译失败。
猜你喜欢
  • 2012-10-28
  • 2015-08-30
  • 1970-01-01
  • 2014-09-24
  • 2015-11-25
  • 2019-08-16
  • 2012-01-29
  • 2013-02-19
相关资源
最近更新 更多