【maven项目结构】module 生成独立的jar
生成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的更多相关文章
- Maven01 环境准备、maven项目结构、编译/测试/打包/清除、安装、
0 前提准备 0.1 安装java开发环境 0.2 安装maven工具 1 maven项目基本结构 如图所示,整个maven项目有业务文件.测试文件.POM依赖管理文件:其实还有一个资源文件resou ...
- 如何将maven项目打包成可执行的jar
如何将maven项目打包成可执行的jar 分类: maven2010-12-17 10:18 10411人阅读 评论(2) 收藏 举报 jarmavenassemblyjava 方法一:将项目及所依赖 ...
- 玩转IDEA项目结构Project Structure,打Jar包、模块/依赖管理全搞定
前言 你好,我是A哥(YourBatman). 如何给Module模块单独增加依赖? 如何知道哪些Module模块用了Spring框架,哪些是web工程? IDEA如何打Jar包?打War包? 熟练的 ...
- maven项目打包时生成dependency-reduced-pom.xml
今天给maven项目打jar包,发现在pom.xml文件的同路径下,突然生出了一个dependency-reduced-pom.xml,也不知道这个文件是干什么的,看着别扭就想着删除了它. 后来知道是 ...
- javaweb的maven项目结构
本来准备看javaweb的项目结构,因为之前自己建maven的项目结构,总是各种出错,后来干脆用maven自己携带的项目结构. 一个最基本的web目录结构如下,红框部分为必须有的,其他的随意. 这是一 ...
- maven项目打包成可执行的jar
编写功能类: package com.hpay.FileToZkUtil; import java.io.File; import java.io.FileInputStream; import ja ...
- 一个maven项目打多个可执行Jar文件
使用maven-jar-plugin插件可以将一个maven项目按照需求打出多个可执行的jar文件. pom关键配置如下所示: <plugin> <groupId>org.ap ...
- maven(三):maven项目结构及其运行机制
在上一篇中讲了如何创建maven项目,现在回到那个项目 项目结构 src/main/java:java代码目录 src/main/resources:资源目录,比如spring.xml文件,prope ...
- Maven项目结构
maven项目主体结构: 另外,Eclipse新建项目时会生成.project..classpath及.settings目录下的文件,这些文件用于描述一个Eclipse项目, 接下来做一个简要的解析: ...
随机推荐
- Objective-C ,ios,iphone开发基础:使用第三方库FMDB连接sqlite3 数据库,实现简单的登录
第一步:下载第三方库,点击 连接 下载, 第二部:准备数据库:按照连接&中博客的步骤实现数据库, 数据库的设计大致如下表: id username pas ...
- LeetCode 263
Ugly Number Write a program to check whether a given number is an ugly number. Ugly numbers are posi ...
- [未完成]关于GUI Java图形化界
"笔记内容完成,整体未完成" GUI 图形化用户界面 用java做图形化用户界面的程序不多,大多用C++和defy.因为,Java做图形化效率低. 首先你要安装一个虚拟机,C++是 ...
- 使用 autoconf
在此之前先说一下autooconf在linux下安装的问题,因为不知道怎么安装,我就直接在终端上输入autoconf,结果它会提示是否安装它,下面还有指定安装的方法,我 就直接输入,是什么命令记不住了 ...
- CSS3如何实现2D转换和3D转换,他们有何区别
CSS3中2D3D技术的发展,带来了更丰富的视觉效果~他们的实现机理是怎样的呢? 1定义 2D: 能够对元素进行移动,缩放,转动,拉长或拉伸. 3D: 允许对元素进行格式化,在三维空间进行操作.元素改 ...
- SQL语句添加,删除主键
IF EXISTS (SELECT * FROM sys.all_objects WHERE type_desc= N'主键名')begin --删除主键 alter table 表名 drop ...
- 如何在UINavigationBar上添加UISearchBar以及UISearchDisplayController的使用 --OC --iOS
那我们开始吧,下面是Sely写的一个Demo,分享给大家. 新建一个项目, UISearchDisplayController 的 displaysSearchBarInNavigationBar太死 ...
- UITableView的简单使用
UITableView分为两种style:UITableViewStyleGrouped和UITableViewStylePlain. (一)UITableViewStyleGrouped #impo ...
- C# ASPX.NET 文件(图片)下载
最好使用aspx页面写: protected void Page_Load(object sender,EventArgs e) { if(!IsPostBack) { System.Io.FileS ...
- 如何把网站及数据库部署到Windows Azure
http://edi.wang/Post/2014/1/1/deploying-website-with-db-to-azure-custom-domain