문제

This is my pom.xml build configuration:

<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>

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

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

[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

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

도움이 되었습니까?

해결책

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.

다른 팁

403 means Forbidden.

Check with the official documentation in order to configure authentication to the Tomcat manager (parameters Server, password, username).

Duncan Jones is right : you are not executing the correct plugin : use tomcat7.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top