gpt4 book ai didi

java - 如何在 pom.xml 中定义特定的 jar 以部署到 TOMCAT/lib 文件夹?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:14:06 24 4
gpt4 key购买 nike

在我的部署过程中,我需要将特定的 jar 部署到 TOMCAT/lib 文件夹,而不是默认部署位置 WEB-INF/lib。有没有办法将它指定给 Maven pom.xml,这样我就不需要单独考虑这个 jar?

具体项目是基于Alfresco的Alfresco Maven plugin构建的Alfresco的扩展.然而,这在我看来是任何 Java 开发人员都应该想要的要求,而不管使用的技术是什么。我错过了显而易见的事情吗?

最佳答案

我想我明白你在问什么,如果我有误解,请告诉我。

Alfresco 的 SDK 版本 3.0.1 的 Maven 插件(至少我目前正在使用)有一个名为 tomcatDependencies 的配置标签在他们的文档中提到了 here .

话虽如此,它并没有真正解释如何使用它。

这是一个片段,显示了为它使用的 Tomcat 插件配置依赖项。

            <groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
<configuration>
<tomcatDependencies>
<tomcatDependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0</version>
</tomcatDependency>
</tomcatDependencies>
<!-- disabling the flat file H2 database to run the Repo -->
<enableH2>false</enableH2>
<!-- using the enterprise DB global properties where we configure oracle DB -->
<enableEnterpriseDb>true</enableEnterpriseDb>

您可以在本地 maven 存储库中安装 jar,然后将其作为 tomcat 依赖项进行引用。

Here's a link to some directions on how to install that jar to your local maven repo .

希望这就是您要找的。

关于java - 如何在 pom.xml 中定义特定的 jar 以部署到 TOMCAT/lib 文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38990612/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com