我尝试使用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<tab>
时,自动填充功能仅显示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,所有软件都是通过存储库安装的。
答案 0 :(得分:1)
据我所知,tomcat7 mojo还没有一些目标,而mvn tomcat7:list
就是其中之一。 mvn tomcat6:list
可用于tomcat6 mojo。