【问题标题】:Tomcat 7.0 Maven Plugin - configuration in settings.xmlTomcat 7.0 Maven 插件 - settings.xml 中的配置
【发布时间】:2012-03-19 03:41:14
【问题描述】:

我查看了有关 Stack Overflow 的其他相关问题,但找不到任何可以回答我问题的内容 - 如果我遗漏了什么,请告诉我...

我正在使用 Maven Tomcat 插件将应用程序部署到我的本地 Tomcat 7.0 服务器。 Maven Tomcat 插件的默认管理器 URL 是:

http://localhost:8080/manager

在我的 Tomcat 安装中,管理器(脚本)的 URL 是:

http://localhost:8080/manager/text

这是默认设置 - 也许在 Tomcat 7.0 中已更改?无论如何,可以在 pom.xml 中为相关项目轻松配置正确的 URL:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
    </configuration>
</plugin>

我的问题是:这可以在 Maven 设置中配置,而不是在逐个项目的基础上进行配置吗?这似乎是特定于环境的设置,而不是我一定要包含在 POM 中的内容?

谢谢 詹姆斯

【问题讨论】:

    标签: tomcat maven tomcat7


    【解决方案1】:

    请注意,tomcat 插件现在托管在 Apache 上,请参阅 http://tomcat.apache.org/maven-plugin-2.0-beta-1/

    为了同时支持 tc6/7,现在有两个插件 tomcat6 和 tomcat7。

    最好是使用属性:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>tomcat-maven-plugin</artifactId>
        <configuration>
          <url>${tomcatManagerUrl}</url>
        </configuration>
    </plugin>
    

    因为它可以在 settings.xml 中定义和/或覆盖 -DtomcatManagerUrl=

    -- 奥利维尔

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-21
      • 2017-07-22
      • 2013-01-18
      相关资源
      最近更新 更多