为什么tomcat-maven-plugin试图部署到错误的URL? [英] Why is tomcat-maven-plugin trying to deploy to the wrong URL?

查看:129
本文介绍了为什么tomcat-maven-plugin试图部署到错误的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个包含两个模块的虚拟maven项目,我已经包含了一个通用的pom.xml文件。我能够从根pom.xml文件构建并运行所有测试,但是当它将文件部署到Tomcat时,它就会崩溃。我的插件是:

I am creating a dummy maven project with two modules, and I have included a general pom.xml file. I am able to build from the root pom.xml file and run all the tests but when it comes to deploying the files to Tomcat, it falls down. The plugin I have is:

<build>
    <finalName>dummy</finalName>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>tomcat-maven-plugin</artifactId>
            <configuration>
                <url>http://127.0.0.1:8090/manager/text</url>
                <server>TomcatServer</server>
                <path>/dummy</path>
            </configuration>
        </plugin>
    </plugins>
</build>

settings.xml

settings.xml

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

但是,当我运行构建时,它使用默认配置值,我收到以下错误消息:

However, when I run the build it uses the default configuration values and I get the following error message:


无法在项目webapp上执行目标org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy(default-cli):无法调用Tomcat管理器: http:// localhost:8080 / manager / deploy?path = %2Fwebapp& war = - > [帮助1]

Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project webapp: Cannot invoke Tomcat manager: http://localhost:8080/manager/deploy?path=%2Fwebapp&war= -> [Help 1]

有谁知道如何让插件使用我的配置?

Does anyone know how I can get the plugin to be using my config?

更多输出:

[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ webapp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [webapp] in [C:\Websites\www.dummy.app\webapp\target\webapp]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Websites\www.dummy.app\webapp\src\main\webapp]
[INFO] Webapp assembled in [15 msecs]
[INFO] Building war: C:\Websites\www.dummy.app\webapp\target\webapp.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO]
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) @ webapp <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) @ webapp ---
[INFO] Deploying war to http://localhost:8080/webapp
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my-app ............................................ SUCCESS [4.747s]
[INFO] webapp ............................................ FAILURE [3.313s]
[INFO] dummy ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.376s
[INFO] Finished at: Mon Jan 23 22:46:11 GMT 2012
[INFO] Final Memory: 18M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project webapp: Cannot invoke Tomcat manager: http://localhost:8080/manager/deploy?path=%2Fwebapp&war= -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :webapp

谢谢

推荐答案

<properties>
   <maven.tomcat.url>http://localhost:8080/manager/text</maven.tomcat.url>
</properties>

为我修好了。

这篇关于为什么tomcat-maven-plugin试图部署到错误的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆