gpt4 book ai didi

java - Maven 在使用 tomcat7-maven-plugin 时找不到 tomcat7 目标

转载 作者:行者123 更新时间:2023-11-30 11:24:15 34 4
gpt4 key购买 nike

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

设置.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,所有软件都是通过存储库安装的。

最佳答案

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

关于java - Maven 在使用 tomcat7-maven-plugin 时找不到 tomcat7 目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20732214/

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