我得到了一个maven项目来编译并部署到tomcat服务器上。在今天之前,我从未使用过maven,但我在谷歌上搜索了不少。这个项目中的顶级pom.xml文件似乎将打包类型设置为pom。
我应该做什么mvn安装后得到这个应用程序部署?我希望能在某个地方找到战争文件或其他东西,但我想我找错了地方或错过了一个步骤。
我得到了一个maven项目来编译并部署到tomcat服务器上。在今天之前,我从未使用过maven,但我在谷歌上搜索了不少。这个项目中的顶级pom.xml文件似乎将打包类型设置为pom。
我应该做什么mvn安装后得到这个应用程序部署?我希望能在某个地方找到战争文件或其他东西,但我想我找错了地方或错过了一个步骤。
当前回答
为了简单地回答您的问题,当您执行mvn:install时,maven将基于(pom.xml中的打包属性)创建一个打包的工件。运行maven install后,您可以找到扩展名为.package的文件
In target directory of the project workspace Also where your maven 2 local repository is search for (.m2/respository) on your box, Your artifact is listed in .m2 repository under (groupId/artifactId/artifactId-version.packaging) directory If you look under the directory you will find packaged extension file and also pom extension (pom extension is basically the pom.xml used to generate this package) If your maven project is multi-module each module will two files as described above except for the top level project that will only have a pom
其他回答
“pom”包装只是容器,它包含其他包/模块,如jar、war和ear。
如果你在外部包/容器上执行任何操作,比如MVN清洁编译安装。然后内部包/模块也得到干净的编译安装。
不需要为每个包/模块单独执行操作。
为了简单地回答您的问题,当您执行mvn:install时,maven将基于(pom.xml中的打包属性)创建一个打包的工件。运行maven install后,您可以找到扩展名为.package的文件
In target directory of the project workspace Also where your maven 2 local repository is search for (.m2/respository) on your box, Your artifact is listed in .m2 repository under (groupId/artifactId/artifactId-version.packaging) directory If you look under the directory you will find packaged extension file and also pom extension (pom extension is basically the pom.xml used to generate this package) If your maven project is multi-module each module will two files as described above except for the top level project that will only have a pom
现实生活用例
在一家java含量很高的公司,我们有一个python项目,需要进入一个Nexus工件存储库。Python并没有二进制文件,所以我只是想把Python文件压缩成。tar或。zip然后推送。这个repo已经集成了maven,所以我们使用了<packaging>pom</packaging>指示符和maven程序集插件来将python项目打包为.zip文件并上传。
这篇SO文章概述了这些步骤
https://maven.apache.org/pom.html
父和聚合(多模块)项目的打包类型必须是pom。这些类型定义了绑定到一组生命周期阶段的目标。例如,如果打包是jar,那么打包阶段将执行jar:jar目标。如果打包是pom,执行的目标将是site:附件-描述符
POM(项目对象模型)不过是构建项目的自动化脚本,我们可以用XML编写自动化脚本, 构建脚本文件在不同的自动化工具中有不同的名称
比如ANT里的build.xml, MAVEN里的pom.xml
MAVEN可以包装罐子,战争,耳朵和POM,这是我们所有人的新事物
如果你想检查什么是POM.XML