生成jar

生成jar的过程会出现以下问题:

clean完了之后就会出现以下问题:

"D:\Program Files\Java\JDK\jdk1.8.0_31\bin\java" "-Dmaven.home=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port= "-Didea.launcher.bin.path=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\bin" -Dfile.encoding=GBK -classpath "D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1. install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building oxgren-common 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ oxgren-common ---
[debug] execute contextualize
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.:compile (default-compile) @ oxgren-common ---
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling source files to D:\JavaWorkSpace\oxgren\oxgren-common\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
D:\Program Files\Java\JDK\jdk1..0_31\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: .114s
[INFO] Finished at: Mon Sep :: CST
[INFO] Final Memory: 7M/164M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.:compile (default-compile) on project oxgren-common: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] D:\Program Files\Java\JDK\jdk1..0_31\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help ]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help ] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException Process finished with exit code

在目录上compile module  再去  install 就可以生成jar包了

jre找不到  不关心这么多了 ,正确的如下

"D:\Program Files\Java\JDK\jdk1.8.0_31\bin\java" "-Dmaven.home=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port= "-Didea.launcher.bin.path=D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\bin" -Dfile.encoding=GBK -classpath "D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;D:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1.2\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1. install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building oxgren-common 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ oxgren-common ---
[debug] execute contextualize
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.:compile (default-compile) @ oxgren-common ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ oxgren-common ---
[debug] execute contextualize
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\JavaWorkSpace\oxgren\oxgren-common\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.:testCompile (default-testCompile) @ oxgren-common ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ oxgren-common ---
[INFO] Surefire report directory: D:\JavaWorkSpace\oxgren\oxgren-common\target\surefire-reports -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running Base64HanderTest
encodeStr:6L+b5YWlamF2YeeahOS4lueVjA==
urlEncodeStr:6L-b5YWlamF2YeeahOS4lueVjA==
mimeEncodeStr:6L+b5YWlamF2YeeahOS4lueVjA==
Tests run: , Failures: , Errors: , Skipped: , Time elapsed: 0.094 sec
Running WithAttachmentMessageTest
发送邮件
Tests run: , Failures: , Errors: , Skipped: , Time elapsed: 0.125 sec Results : Tests run: , Failures: , Errors: , Skipped: [INFO]
[INFO] --- maven-jar-plugin:2.3.:jar (default-jar) @ oxgren-common ---
[INFO] Building jar: D:\JavaWorkSpace\oxgren\oxgren-common\target\oxgren-common-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.:install (default-install) @ oxgren-common ---
[INFO] Installing D:\JavaWorkSpace\oxgren\oxgren-common\target\oxgren-common-1.0-SNAPSHOT.jar to C:\Users\yuchao\.m2\repository\oxgren\oxgren-common\1.0-SNAPSHOT\oxgren-common-1.0-SNAPSHOT.jar
[INFO] Installing D:\JavaWorkSpace\oxgren\oxgren-common\pom.xml to C:\Users\yuchao\.m2\repository\oxgren\oxgren-common\1.0-SNAPSHOT\oxgren-common-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: .785s
[INFO] Finished at: Mon Sep :: CST
[INFO] Final Memory: 9M/164M
[INFO] ------------------------------------------------------------------------ Process finished with exit code

如果test存在不通过的内容,也无法完成jar

【maven项目结构】module 生成独立的jar的更多相关文章

  1. Maven01 环境准备、maven项目结构、编译/测试/打包/清除、安装、

    0 前提准备 0.1 安装java开发环境 0.2 安装maven工具 1 maven项目基本结构 如图所示,整个maven项目有业务文件.测试文件.POM依赖管理文件:其实还有一个资源文件resou ...

  2. 如何将maven项目打包成可执行的jar

    如何将maven项目打包成可执行的jar 分类: maven2010-12-17 10:18 10411人阅读 评论(2) 收藏 举报 jarmavenassemblyjava 方法一:将项目及所依赖 ...

  3. 玩转IDEA项目结构Project Structure,打Jar包、模块/依赖管理全搞定

    前言 你好,我是A哥(YourBatman). 如何给Module模块单独增加依赖? 如何知道哪些Module模块用了Spring框架,哪些是web工程? IDEA如何打Jar包?打War包? 熟练的 ...

  4. maven项目打包时生成dependency-reduced-pom.xml

    今天给maven项目打jar包,发现在pom.xml文件的同路径下,突然生出了一个dependency-reduced-pom.xml,也不知道这个文件是干什么的,看着别扭就想着删除了它. 后来知道是 ...

  5. javaweb的maven项目结构

    本来准备看javaweb的项目结构,因为之前自己建maven的项目结构,总是各种出错,后来干脆用maven自己携带的项目结构. 一个最基本的web目录结构如下,红框部分为必须有的,其他的随意. 这是一 ...

  6. maven项目打包成可执行的jar

    编写功能类: package com.hpay.FileToZkUtil; import java.io.File; import java.io.FileInputStream; import ja ...

  7. 一个maven项目打多个可执行Jar文件

    使用maven-jar-plugin插件可以将一个maven项目按照需求打出多个可执行的jar文件. pom关键配置如下所示: <plugin> <groupId>org.ap ...

  8. maven(三):maven项目结构及其运行机制

    在上一篇中讲了如何创建maven项目,现在回到那个项目 项目结构 src/main/java:java代码目录 src/main/resources:资源目录,比如spring.xml文件,prope ...

  9. Maven项目结构

    maven项目主体结构: 另外,Eclipse新建项目时会生成.project..classpath及.settings目录下的文件,这些文件用于描述一个Eclipse项目, 接下来做一个简要的解析: ...

随机推荐

  1. div 并排

    <style type="text/css">#d1 {float:left;background:#f00;}#d2 {float:left;background:# ...

  2. python(6)-logging 日志模块

    logging的日志分为5个级别分别为debug(), info(), warning(), error(), critical() 先来看一下简单的代码: logging.basicConfig(f ...

  3. HDU 4433 locker

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4433 这是一道2012年ACM天津赛区现场赛的题目,大意是给出两串数字,求用最少的转换次数将一串(A) ...

  4. 锋利的jQuery第2版学习笔记4、5章

    第4章,jQuery中的事件和动画 注意:使用的jQuery版本为1.7.1 jQuery中的事件 JavaScript中通常使用window.onload方法,jQuery中使用$(document ...

  5. HDOJ2003求绝对值

    求绝对值 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  6. Httpclient 和jsoup结和提取网页内容(某客学院视频链接)

    最近在极客学院获得体验会员3个月,然后就去上面看了看,感觉课程讲的还不错.整好最近学习Android,然后去上面找点视频看看.发现只有使用RMB买的会员才能在上面下载视频.抱着试一试的态度,去看他的网 ...

  7. 最新app源码下载:200款优秀Android项目源码

    200款优秀Android项目源码!菜鸟必备!Android开发又将带来新一轮热潮,很多开发者都投入到这个浪潮中去了,创造了许许多多相当优秀的应用.其中也有许许多多的开发者提供了应用开源项目,贡献出他 ...

  8. 我是如何自学Android,资料分享

       我是如何自学Android,资料分享(2015 版) 已经完成,我的建议是先把这一篇看完,再看2015 版的.关于我在学习中开发的项目代码,已经发布在: 爱开发-源码搜索,集成了上万个App源码 ...

  9. Android之手机屏幕的获取

    屏幕区域的获取: activity.getWindowManager().getDefaultDisplay(); 应用区域的获取: Rect outRect = new Rect(); activi ...

  10. 【Android学习】自定义Android样式checkbox

    下面简单介绍下在Androdi中如何更改Checkbox的背景图片,可以自定义样式 1.首先res/drawable中定义编写如下样式的XML,命名为:checkbox_style: <?xml ...