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 朔望魔刃
主站蜘蛛池模板:
国产亚洲精品高清在线
|
亚洲永久中文字幕在线
|
亚洲成在人线在线播放无码
|
www免费插插视频
|
免费a级毛片在线观看
|
亚洲bt加勒比一区二区
|
亚洲欧洲国产综合AV无码久久
|
2019中文字幕在线电影免费
|
亚洲成人高清在线
|
美女黄色毛片免费看
|
亚洲国产成人精品女人久久久
|
色爽黄1000部免费软件下载
|
希望影院高清免费观看视频
|
亚洲综合色在线观看亚洲
|
久久久久免费视频
|
婷婷亚洲综合五月天小说
|
精品无码免费专区毛片
|
亚洲娇小性xxxx
|
日本免费一区二区在线观看
|
亚洲一区电影在线观看
|
国产午夜鲁丝片AV无码免费
|
亚洲www在线观看
|
国产精品国产午夜免费福利看
|
一边摸一边桶一边脱免费视频
|
亚洲一区二区三区写真
|
一区二区免费视频
|
亚洲一区二区三区在线观看蜜桃
|
成年丰满熟妇午夜免费视频
|
高清免费久久午夜精品
|
久久精品国产精品亚洲艾草网
|
18禁网站免费无遮挡无码中文
|
亚洲欧洲免费无码
|
亚洲国产精品无码中文字
|
久久精品成人免费观看97
|
亚洲欧洲日产国码久在线观看
|
中文在线观看国语高清免费
|
亚洲国产日韩在线观频
|
一级毛片aaaaaa免费看
|
亚洲国产成人无码AV在线
|
亚洲狠狠婷婷综合久久久久
|
成人毛片视频免费网站观看
|