maven打包之eclipse中如何打对应maven项目的jar或者war包

maven打包之eclipse中如何打对应maven项目的jar或者war包

1.如何决定打jar包还是war包

通过pom.xml中的配置决定,packaging值为jar或war
在这里插入图片描述

2.eclipse中运行maven install

在这里插入图片描述

eclipse 控制台输出

[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...e the preferred\n   | server for that repository.\n   |-->\n\t<mirror>... @146:10)  @ E:\using\apache-maven-3.3.1\conf\settings.xml, line 146, column 10
[WARNING] Unrecognised tag: 'mirror' (position: START_TAG seen ...e the preferred\n   | server for that repository.\n   |-->\n\t<mirror>... @146:10)  @ E:\using\apache-maven-3.3.1\conf\settings.xml, line 146, column 10
[WARNING] 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building demo-base Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ demo-base ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\workspace\github\MyRepository\demo-back-end\demo-base\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ demo-base ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ demo-base ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\workspace\github\MyRepository\demo-back-end\demo-base\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ demo-base ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ demo-base ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ demo-base ---
[INFO] Building jar: E:\workspace\github\MyRepository\demo-back-end\demo-base\target\demo-base.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ demo-base ---
[INFO] Installing E:\workspace\github\MyRepository\demo-back-end\demo-base\target\demo-base.jar to D:\mavenRepository\demo\demo-base\0.0.1-SNAPSHOT\demo-base-0.0.1-SNAPSHOT.jar
[INFO] Installing E:\workspace\github\MyRepository\demo-back-end\demo-base\pom.xml to D:\mavenRepository\demo\demo-base\0.0.1-SNAPSHOT\demo-base-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.774 s
[INFO] Finished at: 2018-10-14T16:45:28+08:00
[INFO] Final Memory: 11M/241M
[INFO] ------------------------------------------------------------------------

我们可以看到在
D:\mavenRepository\demo\demo-base\0.0.1-SNAPSHOT
下面生成了 demo-base-0.0.1-SNAPSHOT.jar包
在这里插入图片描述

3.备注 如何确定包生成在那里

这个是由安装apache-maven的时候自己的本地仓库在哪里决定的;

在这里插入图片描述

只要在本地仓库里有,那么就会优先先用本地仓库的jar包即可

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东山富哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值