我想使用CLI创建一个用于Maven Project的JAR文件

发布于 2025-02-09 05:05:02 字数 344 浏览 1 评论 0 原文

代码:

在pom.xml文件中,有必要的战争。

现在,我正在使用下面的CLI命令

MVN清洁 构建项目 MVN安装-dpackaging =

在项目中获取JAR文件所需的JAR输出,而由于pom.xml中给定的WAR插件,它正在创建战争文件。

关于如何仅使用CLI生成JAR文件的任何想法,而不是从给定链接中更新pom.xml。

Code : https://github.com/efsavage/hello-world-war/blob/master/pom.xml

Here in POM.XML file there is war which is as required.

Now, I am building project using below CLI commands

mvn clean
mvn install -Dpackaging = jar

Output required to get jar file for a project whereas it is creating the war file due to given war plugin in pom.xml.

Any idea on how can we generate jar file by using only cli , not updating the pom.xml from the given link.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文