生成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. PHP用反撇号(`,也就是键盘上ESC键下面的那个,和~在同一个上面)执行外部命令

    例如: echo `whoami`; // 导出数据库,要导入的文件夹必须要有可写权限, -u -p之后的内容必须要紧挨着写 echo `mysqldump -h localhost -u$DbUse ...

  2. 去掉VC2010 编辑器里出现的红色波浪线

    在VC2010中浏览代码的时候就大片的红线看着不舒服 其实不关VS的事,原因在于visual assist.   在VAssistX菜单栏->Visual Assist X Options-&g ...

  3. LeetCode 326

    Power of Three Given an integer, write a function to determine if it is a power of three. Follow up: ...

  4. [改善Java代码]推荐在复杂字符串操作中使用正则表达式

    一.分析  字符串的操作,诸如追加.合并.替换.倒序.分隔等,都是在编码过程中经常用到的,而且Java也提供了append.replace.reverse.split等方法来完成这些操作,它们使用起来 ...

  5. Windows Embedded CE 6.0开发环境的搭建

    最近开始在学习嵌入式,在这里首先得安装Windows Embedded CE 6.0,其中遇到了很多问题,电脑的系统以及相关配置都会在安装过程中受到影响,因此笔者就安装中的问题以及环境搭建来介绍一下. ...

  6. C#/.NET使用HttpWebRequest、SqlBulkCopy从API获取数据批量插入DB

    小弟新手程序员一枚,代码技术和文章水平均不才.所写文章均为对自己所写所学代码的简单记录,可能对于老手程序员营养价值不高,望莫见怪. 我工作上有个需求:从某处API接口上获取数据(大约1W条而已)并插入 ...

  7. Spring(3.2.3) - Beans(9): @Resoure & @Autowired

    @Resource 和 @Autowired 都是用来装配依赖的,它们之间有些异同. @Resoure @Resource 是 JSR-250 规范的注解. @Resource 可以标注在字段.方法上 ...

  8. JS定位PDF页码。

    由于项目中的PDF文章段落标题有些是英文,对其翻译后需要定位到具体的页码. 查询相关资料及进行尝试后发现可以用如下方法可以实现 function gotoPage(page) {            ...

  9. c#中网络异常的处理办法

    加入try catch来判断,catch使用的WebException来处理 try { var request = WebRequest.Create(uri); using (var respon ...

  10. JQuery合并列(可用于导出Word)

    在网上找了一些JQuery合并列的例子,但是都是用.hide()的方式,这样导致了在导出Word的时候表格严重变形 自己写了一个用.remove()方式的合并列 function arrangeTab ...