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
朔望魔刃
閱讀(15135)
評論(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無法登錄(17840)
2.?maven三種打包插件(15135)
3.?openfire_3.8.2集群配置(9887)
4.?聯想y510p網卡設置(8591)
5.?swing日期控件(6848)
評論排行榜
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人无码亚洲成av无码
|
无码精品国产一区二区三区免费
|
四虎成人免费网址在线
|
99在线热播精品免费99热
|
亚洲国产精品成人综合色在线
|
亚洲综合无码一区二区
|
亚洲精品国产日韩无码AV永久免费网
|
91视频国产免费
|
a级在线观看免费
|
一个人晚上在线观看的免费视频
|
久久久久久亚洲精品影院
|
亚洲麻豆精品果冻传媒
|
一本色道久久综合亚洲精品
|
全亚洲最新黄色特级网站
|
午夜免费不卡毛片完整版
|
亚洲成在人线aⅴ免费毛片
|
国产大片91精品免费观看不卡
|
国产成人AV免费观看
|
一级毛片试看60分钟免费播放
|
妇女自拍偷自拍亚洲精品
|
亚洲乱色伦图片区小说
|
亚洲av乱码一区二区三区
|
亚洲黄色在线观看网站
|
亚洲精品成人av在线
|
亚洲成人中文字幕
|
亚洲动漫精品无码av天堂
|
亚洲午夜久久久久久噜噜噜
|
国产成人99久久亚洲综合精品
|
国产免费131美女视频
|
免费一级肉体全黄毛片
|
又粗又黄又猛又爽大片免费
|
日本特黄特色AAA大片免费
|
国产精品亚洲专一区二区三区
|
亚洲av无码专区青青草原
|
亚洲精品乱码久久久久久蜜桃图片
|
中文字幕久久亚洲一区
|
JLZZJLZZ亚洲乱熟无码
|
国产亚洲一区区二区在线
|
亚洲熟女少妇一区二区
|
精品国产亚洲一区二区三区
|
亚洲成a人片在线观看日本
|