【问题标题】:Maven - tomcat7:deploy uses external tomcat installation whereas tomcat7:run uses mavens custome tomcat installationMaven - tomcat7:deploy 使用外部 tomcat 安装,而 tomcat7:run 使用 mavens custome tomcat 安装
【发布时间】:2014-09-19 08:50:00
【问题描述】:

我有一个 maven 项目,我想使用 apache tomcat7 进行调试。以下是我的 pom.xml 的内容。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
      <overlays>
        <overlay>
          <groupId>org.apache.manifoldcf</groupId>
          <artifactId>mcf-crawler-ui</artifactId>
          <type>war</type>
          <includes>
            <include>*.jsp</include>
            <include>*.css</include>
            <include>*.png</include>
          </includes>
          <targetPath>/</targetPath>
        </overlay>
        <overlay>
          <groupId>org.apache.manifoldcf</groupId>
          <artifactId>mcf-crawler-ui</artifactId>
          <type>war</type>
          <includes>
            <include>WEB-INF/jsp/*</include>
          </includes>
          <targetPath>/</targetPath>
        </overlay>
      </overlays>
    </configuration>
  </plugin>

<plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.1</version>
        <configuration>
                 <server>mytomcatserver</server>
                 <path>/mcf-combined-service</path>
                 <tomcatConfigurationFilesDirectory>/Servers/mytomcatserver-config</tomcatConfigurationFilesDirectory>
                 <url>http://localhost:8080/manager/text</url> 
                 <username>admin</username>
                 <password>admin</password>
                 <!--   <goal>deploy</goal>
                 <goal>run</goal> -->
        </configuration>
  </plugin>

</plugins>

我在eclipse中创建了一个tomcat服务器,名称为mytomcatserver,并让它使用安装目录。我还在 .m2/settings.xml 中指定了这个 tomcat 服务器。 当我在 maven build 中运行 tomcat7:deploy 时,它会将 war 部署到指定的 tomcat 实例,然后我可以从浏览器访问 Web 应用程序。 但我想调试 Web 应用程序,因此当我说 tomcat7:run in maven build 时,它会在目标目录中创建单独的 tomcat 安装,并尝试将 tomcat 部署到无法部署 war 文件的那个安装。

提前致谢。

【问题讨论】:

    标签: maven tomcat maven-tomcat-plugin


    【解决方案1】:

    我使用的人:

    mvnDebug tomcat7:run
    

    然后您就可以连接到端口 8000 上的调试器

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-23
      • 2019-03-15
      • 2014-07-16
      • 1970-01-01
      • 2012-08-25
      • 1970-01-01
      • 2023-03-10
      相关资源
      最近更新 更多