■ 참조 : Jetty Maven Plugin
■ 기본 설정 – spring maven web 프로젝트에의 pom.xml에 아래와 같이 jetty plugin을 등록하고 jetty:rurn goal을 실행하면 localhost 8080포트로 jetty 웹 서버가 시작된다.
<plugin> <groupId> org.eclipse.jetty</groupId > <artifactId> jetty-maven-plugin</artifactId > <version>9.2.10.v20150310 </version > </plugin>
■ 추가 설정
1. httpConnector > port : jetty listen하게될 포트. 기본포트는 8080포트.
2. scanIntervalSeconds : jetty가 시작 후 지정된 시간(초 단위)로 소스 변경을 확인하다가 변경이 확인 되면 자동으로 재시작(hot deploy). 이 속성을 지정하지 않으면 재시작하지 않는다. scan할 대상이 많다면 아래의 scanTargetPatters에서 대상 디렉토리, scan제외 패턴, scan할 패턴을 지정할 수 있으며 scanTargetPatterns는 선택 옵션이다.
<scanTargetPatterns> <scanTargetPattern> <directory> src/main/webapp/WEB-INF</directory > <excludes> <exclude> **/*.jsp</ exclude> </excludes> <includes> <include> **/*.properties</include > <include> **/*.xml</ include> </includes> </scanTargetPattern> </scanTargetPatterns>
3. webApp > contextPath : default는 root(‘/’).
4. dumpOnStart : jetty가 시작될 시점의 web application정보를 console에 dump.
■ maven pom.xml’s Jetty Maven Plugin example
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.10.v20150310</version> <configuration> <scanIntervalSeconds>3</scanIntervalSeconds> <scanTargetPatterns> <scanTargetPattern> <directory>src/main/webapp/WEB-INF</directory> <excludes> <exclude>**/*.jsp</exclude> </excludes> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </scanTargetPattern> </scanTargetPatterns> <httpConnector> <port>9900</port> </httpConnector> <webApp> <contextPath>/aaa</contextPath> </webApp> <dumpOnStart>true</dumpOnStart> </configuration> </plugin>
- Tomcat 시작시 ServletContextListener를 통한 mySQL 접속 2018년 5월 8일
- spring mybatis mysql 연결 예제 2018년 5월 4일
- No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 2017년 12월 4일
- maven filtering – 메이븐 필터링 2016년 10월 24일
- maven profiles – 개발/운영 환경별 빌드 2016년 10월 24일
- maven pom.xml에서 로그 출력하기 2016년 5월 30일
- org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 2016년 5월 2일
- JUnit Controller Test java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig 2016년 3월 22일
- Maven skipTests – Maven JUnit 테스트 안하기 2016년 3월 18일
- maven compile option -Xlint:deprecation 2016년 3월 17일
- Maven encoding 2016년 3월 17일
- TIBCO ActiveSpace Eclipse Maven 2016년 3월 16일
- Jetty Maven Plugin 2016년 3월 9일
- java.lang.UnsupportedClassVersionError: org/eclipse/jetty/maven/plugin/JettyRunMojo : Unsupported major.minor version 52.0 2016년 3월 9일
- java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet 2016년 2월 19일
- eclipse maven 디버그(debug) 모드로 빌드 2014년 11월 21일
- No Spring WebApplicationInitializer types detected on classpath 에러 2014년 11월 21일
- org.apache.ibatis.binding.BindingException 디버깅 2014년 11월 11일
- maven-war-plugin webXml, 개발 환경별 web.xml 관리 2014년 11월 10일
- 명령행 모드 메이븐 프로젝트 생성하기 2014년 9월 17일
- eclipse maven tomcat 자동 재시작 2014년 9월 13일