1.jar:默认的打包方式
2.pom:一般作为父工程或者聚合工程的打包方式,用来定义依赖的版本,或者添加某些公用的依赖。
官方文档:POM Reference
The packaging type required to be pom for parent and aggregation (multi-module) projects. These types define the goals bound to a set of lifecycle stages. For example, if packaging is jar, then the package phase will execute the jar:jar goal. Now we may add values to the parent POM, which will be inherited by its children. Most elements from the parent POM are inherited by its children
3.war:在tomcat容器中运行需要达成war包(springboot tomcat插件可以达成jar包)。
本文详细介绍了Maven项目中常见的三种打包方式:jar、pom和war。jar为默认打包方式,适合普通的Java应用程序;pom常用于父工程或聚合工程,定义依赖版本和公用依赖;war用于Tomcat容器中运行的Web应用。
5万+

被折叠的 条评论
为什么被折叠?



