티스토리 뷰
반응형
jetty는 디렉토리 내의 변경 사항을 모니터링하여 변경점이 생겼을 경우 웹 애플리케이션을 배포하는 hot-deploy 기능이 있다. 이 설정은 기본적으로 1(1초 마다 스캔)로 설정되어있어 자동 배포를 원하지 않을 경우 0(감지 하지 않음)으로 설정하여 비활성화 시켜줘야한다.
jetty8의 경우 /etc/jetty-webapps.xml과 /etc/jetty-contexts.xml 파일 내의 scanInterval 값을 0으로 세팅
<!-- jetty-webapps.xml -->
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- =============================================================== -->
<!-- Add a WebAppProvider to the deployment manager -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This scans the webapps directory for war files and directories -->
<!-- to deploy. -->
<!-- This configuration must be used with jetty-deploy.xml, which -->
<!-- creates the deployment manager instance -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="DeploymentManager">
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
<Set name="scanInterval">1</Set>
<!-- scanInterval의 값을 0으로 세팅 -->
<Set name="contextXmlDir"><Property name="jetty.home" default="." />/contexts</Set>
<Set name="extractWars">true</Set>
</New>
</Arg>
</Call>
</Ref>
</Configure>
<!-- jetty-contexts.xml -->
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- =============================================================== -->
<!-- Add a ContextProvider to the deployment manager -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This scans the webapps directory for war files and directories -->
<!-- to deploy. -->
<!-- This configuration must be used with jetty-deploy.xml, which -->
<!-- creates the deployment manager instance -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="DeploymentManager">
<Call name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.ContextProvider">
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/contexts</Set>
<Set name="scanInterval">1</Set>
<!-- scanInterval의 값을 0으로 세팅 -->
</New>
</Arg>
</Call>
</Ref>
</Configure>
jetty9의 경우 /etc/jetty-deploy.xml 파일 내의 scanInterval 값을 0으로 세팅
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<!-- =============================================================== -->
<!-- Create the deployment manager -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- The deplyment manager handles the lifecycle of deploying web -->
<!-- applications. Apps are provided by instances of the -->
<!-- AppProvider interface. -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
<Set name="contexts">
<Ref refid="Contexts" />
</Set>
<Call name="setContextAttribute">
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
<Arg>.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Arg>
</Call>
<!-- Add a customize step to the deployment lifecycle -->
<!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class
<Call name="insertLifeCycleNode">
<Arg>deployed</Arg>
<Arg>starting</Arg>
<Arg>customise</Arg>
</Call>
<Call name="addLifeCycleBinding">
<Arg>
<New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
<Arg>customise</Arg>
</New>
</Arg>
</Call> -->
<Call id="webappprovider" name="addAppProvider">
<Arg>
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
<Set name="monitoredDirName">
<Property>
<Name>jetty.deploy.monitoredPath</Name>
<Default>
<Property name="jetty.base" default="." />/<Property name="jetty.deploy.monitoredDir" deprecated="jetty.deploy.monitoredDirName" default="webapps"/>
</Default>
</Property>
</Set>
<Set name="defaultsDescriptor">
<Property>
<Name>jetty.deploy.defaultsDescriptorPath</Name>
<Default>
<Property name="jetty.home" default="." />/etc/webdefault.xml
</Default>
</Property>
</Set>
<Set name="scanInterval"><Property name="jetty.deploy.scanInterval" default="1"/></Set>
<!--jetty.deploy.scanInterval의 default 값을 0으로 세팅-->
<Set name="extractWars"><Property name="jetty.deploy.extractWars" default="true"/></Set>
<Set name="configurationManager">
<New class="org.eclipse.jetty.deploy.PropertiesConfigurationManager">
<!-- file of context configuration properties
<Set name="file"><SystemProperty name="jetty.base"/>/etc/some.properties</Set>
-->
<!-- set a context configuration property
<Call name="put"><Arg>name</Arg><Arg>value</Arg></Call>
-->
</New>
</Set>
</New>
</Arg>
</Call>
</New>
</Arg>
</Call>
</Configure>
위처럼 scanInterval 속성의 값을 0으로 세팅하게되면 hot-deploy 기능이 비활성화된다.
참조
- docs.huihoo.com/jetty/the-definitive-reference/hot-deployment.html
- wiki.eclipse.org/Jetty/Feature/ContextProvider
- wiki.eclipse.org/Jetty/Feature/WebAppProvider
반응형
'[기타]' 카테고리의 다른 글
[redis] 리눅스에서 redis 설치 (1) | 2021.06.28 |
---|---|
[윈도우] 윈도우에서 md5 체크섬 확인하기 (0) | 2021.05.11 |
[리눅스] 파일 권한 변경(chmod) (0) | 2021.01.21 |
[표기법] 파스칼 표기법(PascalCase), 카멜 표기법(CamelCase) (0) | 2020.12.10 |
[Gradle] lombok, error: cannot find symbol 에러 (0) | 2020.12.06 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Thread
- 한글깨짐
- IntelliJ
- codepoint
- java
- jdk13
- hot-deploy
- jdk12
- JUnit
- 확인창
- spring-security
- gradle
- Visual Studio 2022
- Redis
- Jenkins
- JPA
- ThreadPool
- 파스칼 표기법
- JetBrains Mono
- JAVA8
- chmod
- java11
- sgw
- thread priority
- junit5
- Executor
- Mockito
- aspectj
- spring
- 카멜 표기법
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함