■ TOMCAT_HOME/conf/tomcat-users.xml에 다음을 추가한다. manager-gui, manager-script role을 가지는 ‘tomcat’ 사용자를 등록하였다.
<tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="tomcat" password="tomcat" roles="manager-gui,manager-script"/> </tomcat-users>
■ pom.xml파일의 build > plugins에 다음을 추가한다.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <warSourceDirectory>src/main/webapp</warSourceDirectory> <webXml>src/main/webapp/WEB-INF/web.xml</webXml> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <url>http://localhost:8080/manager/text</url> <path>/simple</path> <username>tomcat</username> <password>tomcat</password> </configuration> </plugin>
■ Eclipse에서 배포하려는 프로젝트의 pom.xml에서 마우스 오른쪽 버튼을 클릭해서 Run As > 3 Maven build…를 선택한다.
■ Run Configurations화면의 Goals항목에 clean tomcat:undeploy tomcat:deploy -e를 입력하고 > Apply버튼 > Run 버튼을 선택하면 배포 작업이 진행된다. 최초 배포일 경우 tomcat:undeploy를 빼고 실행한다. clean은 eclipse의 target폴더를 지우는 의미이고 -e옵션은 Eclipse Console창에서 배포 진행상황을 자세히 확인할 수 있으며 에러 메세지 또한 자세히 확인할 수 있다.
- Tomcat https 서비스(SSL, keystore) 2015년 7월 26일
- tomcat java.lang.OutOfMemoryError: PermGen space 2016년 2월 23일
- tomcat-maven-plugin을 통한 maven tomcat배포 2016년 2월 23일
- ServletContextLister를 구현한 웹 애플리케이션 시작 시 작업 2016년 5월 2일
- Tomcat 시작시 ServletContextListener를 통한 mySQL 접속 2018년 5월 8일
- Tomcat Startup timeout error in Eclipse 2018년 5월 24일
- Tomcat : consider increasing the maximum size of the cache 2019년 3월 4일