Maven尝试部署到localhost而不是远程服务器 [英] Maven attempting to deploy to localhost instead of remote server

查看:186
本文介绍了Maven尝试部署到localhost而不是远程服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 pom.xml 构建配置:

<build>
    <finalName>cfwd</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>2.3.2</version>
              <configuration>
                <source>1.6</source>
                <target>1.6</target>
              </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat7-maven-plugin</artifactId>
              <version>2.0</version>        
              <configuration>
                <url>http://xx.xxx.xxx.xxx:8080/manager/text</url>
                <server>cifServer</server>
                <path>/cfwd</path>
                <addContextWarDependencies>true</addContextWarDependencies>
                <addWarDependenciesInClassloader>true</addWarDependenciesInClassloader>        
              </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

其中 http://xx.xxx.xxx.xxx:8080 是远程服务器IP。

where http://xx.xxx.xxx.xxx:8080 is the remote server IP.

当我尝试通过 mvn tomcat部署:部署我收到此错误:

When I try to deploy via mvn tomcat:deploy I get this error:


[错误]无法执行目标
org.codehaus.mojo:tomcat-maven-plugin: 1.1:在
项目上部署(default-cli)项目cfwd:无法调用Tomcat管理器:服务器返回HTTP
响应代码:403用于URL:
http:// localhost :8080 / manager / deploy?path =%2Fcfwd& war = - > [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
执行目标org失败.codehaus.mojo:tomcat-maven-plugin:1.1:在项目cfwd上部署
(default-cli):无法调用Tomcat管理器

[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project cfwd: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/deploy?path=%2Fcfwd&war= -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project cfwd: Cannot invoke Tomcat manager

看起来maven试图部署到 localhost:8080 而不是远程服务器IP。有什么想法?

where it looks like maven is attempting to deploy to localhost:8080 rather than the remote server IP. Any idea?

推荐答案

你需要执行 mvn tomcat7:deploy (注意'7')以触发您配置的插件。

You need to execute mvn tomcat7:deploy (note the '7') in order to trigger the plugin you've configured.

请参阅此页面了解有关可用目标的更多信息。

See this page for more information about the available goals.

这篇关于Maven尝试部署到localhost而不是远程服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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