본문 바로가기
FullStack/41. WEB.WAS

Maven 으로 Tomcat 7.0 배포할때 오류[Cannot invoke Tomcat manager: Server returned HTTP response code: 403]

by nakanara 2012. 3. 13.
반응형

Maven 으로 열심히 설정을 따라하고 있는데. Tomcat 서버에 Deploy가 되지 않아서 구글링을 하였다.
원인은 모르겠지만 다음의 설정으로 정상 작동 하였으며, 이전 6.0 버전으로는 테스트해보지 않아서 잘 모르겠다.

- 이전에는 pom.xml에 서버 정보 및 배포 url 이 http://127.0.0.1:8080/manager까지 였던 부분이 http://127.0.0.1:8080/manager/html 로 변경

- pom.xml 에 있던 서버 id, password 부분이 m2\setting.xml 로 이동


pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.nakanara.test</groupId>

  <artifactId>test3</artifactId>

  <packaging>war</packaging>

  <version>0.0.1-SNAPSHOT</version>

  <name>test3 Maven Webapp</name>

  <url>http://maven.apache.org</url>

  <dependencies>

    <dependency>

      <groupId>junit</groupId>

      <artifactId>junit</artifactId>

      <version>3.8.1</version>

      <scope>test</scope>

    </dependency>

  </dependencies>
 

  <build>

    <plugins>

   <plugin>

   <groupId>org.codehaus.mojo</groupId>

   <artifactId>tomcat-maven-plugin</artifactId>

   <configuration>
        <url>http://127.0.0.1:8080/manager</url>  

       <url>http://127.0.0.1:8080/manager/html</url>

                        <server>

                                <id>TomcatServer</id>

                                <username>admin</username>

                                <password>password</password>

                              </server>   

       <server>TomcatServer</server>

       <path>/test03</path>        

   </configuration>

</plugin>

<plugin>

            <artifactId>maven-compiler-plugin</artifactId>

            <configuration>

                <source>1.6</source>

                <target>1.6</target>

            </configuration>

        </plugin>

</plugins>

  </build>

    

</project>



.m2\setting.xml
(원래 pom.xml에 있던 서버 정보가 setting.xml로 이동)

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0

  http://maven.apache.org/xsd/settings-1.0.0.xsd">

  

   <servers>

      <server>

         <id>TomcatServer</id>

         <username>admin</username>

         <password>password</password>

      </server>

   </servers>

</settings>



발생했던 오류 내역

[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project test3: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://127.0.0.1:8080/manager/deploy?path=%2Ftest03&war=&update=true -> [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




참고사이트 
http://www.loquatic.com/wordpress/?p=126  
http://mojo.codehaus.org/  
http://javajigi.tistory.com/131  
반응형