【问题标题】:Maven cannot find tomcat7 goal while using tomcat7-maven-pluginMaven 在使用 tomcat7-maven-plugin 时找不到 tomcat7 目标
【发布时间】:2014-01-11 00:04:59
【问题描述】:

我在尝试使用 maven tomcat 插件将我的 webapp 部署设置到 tomcat 7 时遇到问题。

settings.xml:

<server>
  <id>server</id>
  <username>admin</username>
  <password>password</password>
</server>

pom.xml:

<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <server>server</server>
    <url>http://localhost:8080/manager/text</url>
    <path>/myapp</path>
  </configuration>
</plugin>

当我开始输入 mvn tom&lt;tab&gt; 时,自动完成只建议我 mvn tomcat:

mvn tomcat:list 的输出是:

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'tomcat'.
[INFO] ------------------------------------------------------------------------
[INFO] Building myapp
[INFO]    task-segment: [tomcat:list]
[INFO] ------------------------------------------------------------------------
[INFO] [tomcat:list {execution: default-cli}]
[INFO] Listing applications at http://localhost:8080/manager
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot invoke Tomcat manager

Embedded error: http://localhost:8080/manager/list
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Dec 22 21:37:08 MSK 2013
[INFO] Final Memory: 13M/211M
[INFO] ------------------------------------------------------------------------

看来tomcat6-maven-plugin确实在使用。

mvn tomcat7:list 的输出是:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Required goal not found: tomcat7:list in org.apache.tomcat.maven:tomcat7-maven-plugin:2.2
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sun Dec 22 21:43:41 MSK 2013
[INFO] Final Memory: 7M/116M
[INFO] ------------------------------------------------------------------------

我使用的是 Ubuntu 13.10,所有软件都是通过存储库安装的。

【问题讨论】:

    标签: java maven tomcat maven-tomcat-plugin


    【解决方案1】:

    据我所知,tomcat7 mojo 还没有一些目标,mvn tomcat7:list 就是其中之一。 mvn tomcat6:list 可用于 tomcat6 mojo。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-29
      • 1970-01-01
      • 2014-08-07
      • 1970-01-01
      • 1970-01-01
      • 2013-12-03
      • 1970-01-01
      相关资源
      最近更新 更多