java - 如何安装tomcat maven插件?

标签 java maven tomcat cxf maven-archetype

我正在尝试运行基本的 CXF maven 原型(prototype)。

我刚刚尝试使用以下方法手动安装 tomcat7-maven-plugin-2.2.jar:

mvn -X install:install-file -Dfile=/tmp/path/tomcat7-maven-plugin-2.2.jar -DgroupId=org.apache.tomcat.maven -DartifactId=tomcat7-maven-plugin -Dversion=2.2 -Dpackaging=jar

这导致:

[INFO] Installing /tmp/path/tomcat7-maven-plugin-2.2.jar to /home/userxxx/.m2/repository/org/apache/tomcat/maven/tomcat7-maven-plugin/2.2/tomcat7-maven-plugin-2.2.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Jan 23 17:50:42 CET 2015
[INFO] Final Memory: 4M/179M
[INFO] ------------------------------------------------------------------------

但是当我尝试通过以下方式在我的项目中调用它时:

mvn clean install tomcat:run-war

它说:

[INFO] Searching repository for plugin with prefix: 'tomcat'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin '**org.codehaus.mojo**:tomcat-maven-plugin' does not exist or no valid version could be found

你知道为什么 maven 正在寻找“org.codehaus.mojo”groupId 而不是“org.apache.tomcat.maven”吗?

我知道它之前托管在“org.codehaus.mojo”,所以这是一个错误吗?

我应该在这个 groupId 中安装插件吗?

最佳答案

好的,我明白了,CXF 原型(prototype)中的注释是错误的:

            <!-- mvn clean install tomcat:run-war to deploy
            Look for "Running war on http://xxx" and
            "Setting the server's publish address to be /yyy"
            in console output; WSDL browser address will be
            concatenation of the two: http://xxx/yyy?wsdl
            -->

应该说 mvn clean install **tomcat7**:run-war to deploy 以对应他们在此原型(prototype)中使用的插件。

关于java - 如何安装tomcat maven插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28115273/

相关文章:

java - 在 HashMap 和 HashTable 中计算 hashCode 的工作方式是否不同?

java - Apache Ignite 无法找到 XML 模式命名空间的 Spring NamespaceHandler

java - NoClassDefFoundError - RunListener : Maven-surefire/JUnit

windows - 设置tomcat个人网络服务器

java - Servlet 的单元测试

java - java中的循环if和else语句

java - 基于命令行参数创建子类对象的最佳方法

java - 将 OSGI 包导入 eclipse

tomcat - Jetty/Tomcat 在加载/重新加载 .war 时执行的默认方法

java - Tomcat 7 - 连接重置