问题1.maven install时出现,日志如下:

系统资源不足。
有关详细信息,请参阅以下堆栈追踪。

java.lang.OutOfMemoryError: Java heap space
at com.sun.tools.javac.util.List.prepend(List.java:145)
at com.sun.tools.javac.jvm.ClassReader.openArchive(ClassReader.java:1457)
at com.sun.tools.javac.jvm.ClassReader.list(ClassReader.java:1742)
at com.sun.tools.javac.jvm.ClassReader.listAll(ClassReader.java:1882)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1903)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1538)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:256)
at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:382)
at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:221)
at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:235)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:444)
at com.sun.tools.javac.comp.Enter.main(Enter.java:429)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:404)
at com.sun.tools.javac.main.Main.compile(Main.java:592)
at com.sun.tools.javac.main.Main.compile(Main.java:544)
at com.sun.tools.javac.Main.compile(Main.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
at java.lang.reflect.Method.invoke(Method.java:592)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(Javac
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMo
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginM
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defaul
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLife
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Default
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandl
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLife at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMo
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginM
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defaul
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 34 seconds
[INFO] Finished at: Wed Jul 20 17:22:53 CST 2011
[INFO] Final Memory: 60M/63M
[INFO] ------------------------------------------------------------------------

  

原因分析:虚拟机堆溢出,默认只有63M,工程比较多时容易出现此问题

解决方案:在maven启动脚本(mvn.bat)中,重新设置堆大小(set MAVEN_OPTS= -Xms128m -Xmx512m)

问题2:maven install时出现此问题,日志如下:

[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:699)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
Mojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)

  

原因分析:编译不通过,检查JDK版本

解决方案:使用正确的JDK版本,和开发时的一致

今天maven install时碰到的两个问题(堆溢出和编译错误)的更多相关文章

  1. maven install时自动施行单元测试

    maven install时自动执行单元测试 1.maven-surefire-plugin简介 Maven本身并不是一个单元测试框架,它只是在构建执行到特定生命周期阶段的时候,通过插件来执行JUni ...

  2. maven -- 问题解决(一)解决eclipse中maven项目配置过程和maven install时出现的问题

    问题一: 配置项目时出现的错误: error: Cannot change version of project facet Dynamic Web Module to 2.5. error: One ...

  3. Eclipse中Maven Install时发生错误

    问题描述 要把一个本地包保存进本地maven库中, 所以对该project执行了run as => Maven Install, 结果报下面的错误. 解决办法 1. 通过命令窗口手动创建这两个文 ...

  4. maven install时跳过测试

    xl_echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!! - ...

  5. Spring Boot项目在Mac下使用Maven启动时碰到的神奇问题:Unregistering JMX-exposed beans on shutdown

    错误如下: ➜ springboottest1 mvn spring-boot:run [INFO] Scanning for projects... [INFO] [INFO] ---------- ...

  6. eclipse里maven install时,报错提示jdk为无效的目标版本:1.7

    http://blog.csdn.net/wabiaozia/article/details/51733372 ************************************ 报错提示: [ ...

  7. 在eclipse环境下使用maven install 命令碰到native2ascii-utf8问题解决方案

    报错语句:Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:1.0-beta-1:native2ascii (nat ...

  8. maven install 时 pom中skip test

    <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-suref ...

  9. maven install 时提示“程序包 javax.crypto不存在”

    但是javax.crypto是在jdk的jre\lib目录下的 解决方案: <compilerArguments> <bootclasspath>${java.home}/li ...

随机推荐

  1. javascript实现数据结构:串--堆分配存储表示

    堆分配存储表示 这种存储表示的特点是,仍以一组地址连续的存储单元存放串值字符序列,但它们的存储空间是在程序执行过程中动态分配而得. 结构图: 实现: function HString(){ this. ...

  2. 网格导入设置 Import settings for Meshes

    原地址:http://game.ceeger.com/Components/FBXImporter-Model.html The Import Settings for a model file wi ...

  3. 【mysql5.6】下载安装

    每次学新技术最烦的就是安软件了..... 下载的mysql5.6 http://dev.mysql.com/downloads/windows/ 一路默认安装.安装后 1.以管理员身份打开C:\WIN ...

  4. tomcat 跨域

    http://www.360doc.com/content/14/0920/14/7909375_411017244.shtml http://www.tuicool.com/articles/Znq ...

  5. JSON.stringify 函数 (JavaScript)

    在bsrck项目中,使用jQuery.Form.js的ajaxSubmit时,遇到有文件上传的form提交,在firefox和chrome浏览器中测试,报Bad Request的错误,经查代码后发现是 ...

  6. wamp中的phpmyadmin打开出现:#1045 - Access denied for user 'root'@'localhost' (using password: NO)

    详细内容: MySQL said: #1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin ...

  7. shell脚本接收输入

    shell脚本接受输入 while read var do cat logs | grep IconsendRedirect | grep $var | awk -F'\t' '{print $8}' ...

  8. iOS开发--提交github代码

    将的SampleTable例子提交到github 具体步骤如下: a. 首先登陆github b. 创建新的reponsitory name, description c. 打开terminal, c ...

  9. Ibm-jQuery教程学习笔记

    一.概述 1.虽然 jQuery 本身并非一门新的语言.但是,学习其语法有助于我们熟练.灵活地使用它.回顾下我们熟悉的 CSS 语法,不难发现 jQuery 的语法与 CSS 有相似之处. jQuer ...

  10. Two Sigma OA

    刚做了两道Two Sigma OA. 还是两道老题, Friend Cycle和Longest Chain. Friend Cycle可以用Union Find来做.优化的时候因为矩阵是沿对角线对称, ...