[英]How to add JAR file to an existing WAR file web-inf/lib folder?
My setup is the following:我的设置如下:
So far I was deploying the war file to my local Tomcat and added the jar to the lib folder of the Tomcat installation.到目前为止,我正在将 war 文件部署到我的本地 Tomcat 并将 jar 添加到 Tomcat 安装的 lib 文件夹中。 I would like to switch to a single executable war file so that I can run it via command line and not using separate Tomcat instance.
我想切换到一个可执行的war文件,这样我就可以通过命令行运行它,而不是使用单独的 Tomcat 实例。
How can I achieve my goal using Maven?如何使用 Maven 实现我的目标?
Robert's suggestion was correct, I would like to summarize what exactly I had to do:罗伯特的建议是正确的,我想总结一下我到底要做什么:
Set up the plugin correctly:正确设置插件:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.0</version> <configuration> <recompressZippedFiles>false</recompressZippedFiles> <archive> <manifestFile>src/main/resources/MANIFEST.MF</manifestFile> <compress>false</compress> </archive> <failOnMissingWebXml>false</failOnMissingWebXml>... </build>
I had to explicitly copy the manifest file (it was ignored) and disable jar compression.我必须明确复制清单文件(它被忽略)并禁用 jar 压缩。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.