fantasy-java
我越發的感覺到你就是我生命中的精靈,翻轉跳躍在我那空虛的時空;有人說世界上最美的是春天和愛情,在我眼中有你的地方就是最美的。
BlogJava
首頁
新隨筆
聯系
聚合
管理
隨筆-95 評論-31 文章-10 trackbacks-0
maven三種打包插件
第一種:可執行jar與依賴分開,依賴在lib目錄里,需要jar和lib目錄在同級目錄,
優點:jar文件很小
缺點:需要放置lib文件夾在平級目錄
1
<
plugin
>
2
<
groupId
>
org.apache.maven.plugins
</
groupId
>
3
<
artifactId
>
maven
-
jar
-
plugin
</
artifactId
>
4
<
version
>
2.6
</
version
>
5
<
configuration
>
6
<
archive
>
7
<
manifest
>
8
<
addClasspath
>
true
</
addClasspath
>
9
<
classpathPrefix
>
lib
/</
classpathPrefix
>
10
<
mainClass
>
com.xxx.xxxService
</
mainClass
>
11
</
manifest
>
12
</
archive
>
13
</
configuration
>
14
</
plugin
>
15
<
plugin
>
16
<
groupId
>
org.apache.maven.plugins
</
groupId
>
17
<
artifactId
>
maven
-
dependency
-
plugin
</
artifactId
>
18
<
version
>
2.10
</
version
>
19
<
executions
>
20
<
execution
>
21
<
id
>
copy
-
dependencies
</
id
>
22
<
phase
>
package
</
phase
>
23
<
goals
>
24
<
goal
>
copy
-
dependencies
</
goal
>
25
</
goals
>
26
<
configuration
>
27
<
outputDirectory
>
$
{project.build.directory}
/
lib
</
outputDirectory
>
28
</
configuration
>
29
</
execution
>
30
</
executions
>
31
</
plugin
>
第二種:把所有依賴打進同一個jar包里。
缺點:jar文件會比較大,同時該插件有個bug會缺失spring的xds文件,導致無法運行jar,同時如果同級目錄還有其它可執行jar文件依賴可能會產生沖突
優點:方便快捷,打包完直接就能運行。
1
<
plugin
>
2
<
artifactId
>
maven
-
assembly
-
plugin
</
artifactId
>
3
<
configuration
>
4
<
descriptorRefs
>
5
<
descriptorRef
>
jar
-
with
-
dependencies
</
descriptorRef
>
6
</
descriptorRefs
>
7
<
archive
>
8
<
manifest
>
9
<
mainClass
>
com.xxx.xxxService
</
mainClass
>
10
</
manifest
>
11
</
archive
>
12
</
configuration
>
13
<
executions
>
14
<
execution
>
15
<
id
>
make
-
assembly
</
id
>
16
<
phase
>
package
</
phase
>
17
<
goals
>
18
<
goal
>
single
</
goal
>
19
</
goals
>
20
</
execution
>
21
</
executions
>
22
</
plugin
>
第三種:所有依賴打到同一個jar文件里。
缺點:jar文件過大、如果同級目錄有其它可執行jar,依賴可能會產生沖突
優點:不會有任何bug,直接打成可執行jar文件,最省事。
1
<
plugin
>
2
<
groupId
>
org.apache.maven.plugins
</
groupId
>
3
<
artifactId
>
maven
-
shade
-
plugin
</
artifactId
>
4
<
version
>
2.4
.
3
</
version
>
5
<
executions
>
6
<
execution
>
7
<
phase
>
package
</
phase
>
8
<
goals
>
9
<
goal
>
shade
</
goal
>
10
</
goals
>
11
<
configuration
>
12
<
filters
>
13
<
filter
>
14
<
artifact
>*
:
*</
artifact
>
15
<
excludes
>
16
<
exclude
>
META
-
INF
/**/
/*
.SF</exclude>
17
<exclude>META-INF/*.DSA</exclude>
18
<exclude>META-INF/*.RSA</exclude>
19
</excludes>
20
</filter>
21
</filters>
22
<transformers>
23
<transformer
24
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
25
<resource>META-INF/spring.handlers</resource>
26
</transformer>
27
<transformer
28
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
29
<resource>META-INF/spring.schemas</resource>
30
</transformer>
31
<transformer
32
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
33
<resource>META-INF/spring.tooling</resource>
34
</transformer>
35
<transformer
36
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
37
<mainClass>com.xxx.xxxInvoke</mainClass>
38
</transformer>
39
</transformers>
40
<minimizeJar>true</minimizeJar>
41
<shadedArtifactAttached>true</shadedArtifactAttached>
42
</configuration>
43
</execution>
44
</executions>
45
</plugin>
posted on 2017-05-03 10:08
朔望魔刃
閱讀(15137)
評論(0)
編輯
收藏
所屬分類:
java
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
Jdk和cglib動態代理
mybatis減少resultMap列映射
restful安全認證
spring-boot配置quartz
spring data jpa 小結
spring-boot data jpa 性能優化
spring-boot data jpa 復雜查詢
spring-boot-data-jpa nativeQuery 詳解
spring-boot data jpa
spring-boot 分頁小問題
<
2017年5月
>
日
一
二
三
四
五
六
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
常用鏈接
我的隨筆
我的文章
我的評論
我的參與
最新評論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
Android
flex(1)
git
gradle
IHE&DICOM&HL7的開源框架(1)
java(40)
JavaScript(2)
maven(1)
mybatis
netty(3)
python(3)
spring
svn(1)
即時通信(4)
各種整合
各種配置(9)
數據庫(2)
設計模式&&數據結構(11)
隨筆檔案
2018年8月 (1)
2018年3月 (1)
2018年1月 (1)
2017年12月 (3)
2017年11月 (6)
2017年10月 (1)
2017年8月 (2)
2017年7月 (1)
2017年6月 (1)
2017年5月 (1)
2017年2月 (1)
2016年12月 (3)
2016年10月 (1)
2016年9月 (2)
2015年12月 (1)
2015年7月 (2)
2015年5月 (1)
2015年2月 (3)
2015年1月 (1)
2014年12月 (2)
2014年7月 (1)
2014年5月 (4)
2014年3月 (1)
2013年9月 (6)
2013年8月 (1)
2013年7月 (3)
2013年4月 (1)
2012年7月 (2)
2012年6月 (4)
2012年5月 (2)
2012年1月 (1)
2011年12月 (2)
2011年11月 (2)
2011年9月 (1)
2011年6月 (1)
2011年5月 (1)
2011年3月 (4)
2011年2月 (2)
2010年12月 (2)
2010年9月 (9)
2010年8月 (4)
2010年4月 (1)
2010年3月 (1)
2010年1月 (2)
文章分類
文章(2)
生活(2)
英語學習(3)
詩歌(3)
文章檔案
2011年1月 (2)
2010年12月 (3)
2010年11月 (1)
2010年10月 (1)
2010年9月 (2)
2010年8月 (1)
收藏夾
技術文章(2)
娛樂博客
周德東
郭敬明
韓寒
鬼谷女
牛博
其實我是一個程序員
博客大巴~~
很牛的C++程序員
夢幻之旅
達內恩師
雪山飛鵠
高性能網站專家 淘寶 阿里架構師
搜索
最新評論
1.?re: jsp通過js按鈕導出word小結
下達
--q
2.?re: linux安裝mysql后root無法登錄
謝啦
--galo
3.?re: openfire_3.9.3集群配置
我這根本就不顯示hazelcast 這個插件包。請教下各位大神。
--openfre
4.?re: openfire_3.8.2集群配置[未登錄]
hazelcast-cache-config.xml 文件每一臺都要配4行ip嗎
--wp
5.?re: openfire_3.8.2集群配置
評論內容較長,點擊標題查看
--朔望魔刃
閱讀排行榜
1.?linux安裝mysql后root無法登錄(17842)
2.?maven三種打包插件(15137)
3.?openfire_3.8.2集群配置(9889)
4.?聯想y510p網卡設置(8593)
5.?swing日期控件(6849)
評論排行榜
1.?openfire_3.8.2集群配置(17)
2.?dcm4chee部署安裝(3)
3.?Java Service Wrapper工具把Java程序轉換為Windows服務小結(2)
4.?jsp通過js按鈕導出word小結(2)
5.?XML Schema<一>(1)
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 朔望魔刃
主站蜘蛛池模板:
日本大片在线看黄a∨免费
|
亚洲成人免费在线观看
|
亚洲XX00视频
|
免费激情网站国产高清第一页
|
免费乱理伦在线播放
|
久久精品国产亚洲av品善
|
日本v片免费一区二区三区
|
亚洲精品色播一区二区
|
国产精品99精品久久免费
|
亚洲四虎永久在线播放
|
99在线观看视频免费
|
亚洲性无码av在线
|
最近免费中文字幕大全视频
|
一二三四视频在线观看中文版免费
|
四虎永久在线精品免费观看视频
|
国产精品四虎在线观看免费
|
亚洲欧美aⅴ在线资源
|
免费无码又爽又高潮视频
|
国产亚洲美女精品久久久久
|
AV在线播放日韩亚洲欧
|
无码人妻精品中文字幕免费
|
亚洲国语在线视频手机在线
|
全免费A级毛片免费看网站
|
免费福利资源站在线视频
|
亚洲精品乱码久久久久久
|
国产卡二卡三卡四卡免费网址
|
3344免费播放观看视频
|
亚洲国产美女精品久久久久
|
成人人观看的免费毛片
|
精品国产污污免费网站入口在线
|
亚洲第一区精品日韩在线播放
|
久久精品蜜芽亚洲国产AV
|
永久看日本大片免费35分钟
|
亚洲人成网站在线播放2019
|
久久夜色精品国产亚洲av
|
在线a免费观看最新网站
|
国产综合激情在线亚洲第一页
|
每天更新的免费av片在线观看
|
亚洲色欲色欲www在线丝
|
真实国产乱子伦精品免费
|
亚洲av午夜国产精品无码中文字
|