-
이클립스에서 톰캣서버로 원격배포하기JAVA 2018. 7. 20. 09:46
1.Please change your pom.xml to include
<project>
...
<build>
<plugins>
....
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>my-tomcat</server>
<path>/myapp</path>
</configuration>
</plugin>
</plugins>
...
</build>
...
</project>
2.Make sure your Tomcat 7 server have the following lines on TOMCAT_HOME/conf/tomcat-users.xml:
<!-- Role to manage WAR files via HTML /manager. The name should be as is! -->
<role rolename="manager-gui"/>
<!-- Role to manage WAR files via script like Maven. The name should be as is! -->
<role rolename="manager-script"/>
<!-- One user cannot have manager-gui and manager-script roles -->
<user username="managerGui" password="managerPwd" roles="manager-gui"/>
<user username="manager" password="managerPwd" roles="manager-script"/>
3.Configure your USER_HOME/.m2/settings.xml to include the password.
<settings>
...
<servers>
...
<server>
<id>my-tomcat</id>
<username>manager</username>
<password>managerPwd</password>
</server>
</servers>
</settings>
4.Deploy using mvn tomcat7:redeploy
Read more on http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
'JAVA' 카테고리의 다른 글
스프링 트랜잭션 처리 (0) 2019.01.24 getServletOutputStream() 과 getWriter()는 동시 사용 불가능 (0) 2018.07.16 스프링mvc에서 Ajax and Json View (0) 2017.05.30 JAVA_서블릿 파일 업로드 샘플1 (0) 2017.05.28 vector, ArrayList, LinkedList 차이 (0) 2017.05.14