클라이언트 디플로이어 패키지를 사용해서 디플로이하기
Deploying using the Client Deployer Package
번역 translated by kenu_AT_okjsp.pe.kr

클라이언트 디플로이어는 운영이나 개발 서버에 웹 애플리케이션을 검증, 컴파일, 배치시킬 수 있는 패키지입니다. 이 기능은 자동 배치를 위해서 톰캣 매니저를 사용한다는 것은 알아야 겠죠.
The client deployer is a package which can be used to validate, compile, and deploy a web application to a production or development server. It should be noted that this feature uses the Tomcat manager for automatic deployment.

이 디플로이어는 카탈리나 매니저 앤트 태스크, 배치 전에 JSP 컴파일을 하기 위한 재스퍼 페이지 컴파일러, 그리고 웹 애플리케이션 배치 기술서를 검증하는 태스크를 포함하고 있습니다. 검증 태스크(org.apache.catalina.ant.ValidatorTask 클래스)는 파라미터 하나만 받습니다: 웹 애플리케이션의 기본 경로
The deployer includes the Catalina manager Ant tasks, the Jasper page compiler for JSP compilation before deployment, as well as a task which validates the webapp's deployment descriptor. The validator task (class org.apache.catalina.ant.ValidatorTask) allows only one parameter: the base path of an expanded web application.

디플로이어는 입력으로 펼쳐진 웹 애플리케이션을 이용합니다(아래에 나와 있는 디플로이어의 프로퍼티 목록 참조). 디플로이어가 프로그램으로 배치하게 되는 웹 애플리케이션은 톰캣에 특화된 배치 설정을 포함할 수도 있습니다. /META-INF/context.xml 안에 있는 컨텍스트 설정 XML 파일이죠.
The deployer uses an unpacked web application as input (see the list of the properties used by the deployer below). A web application which is programatically deployed with the deployer may include Tomcat specific deployment configuration, by including a Context configuration XML file in /META-INF/context.xml.

디플로이어 패키지는 다음과 같은 앤트 스크립트 타겟을 사용할 수 있습니다:

  • compile (default): 웹 애플리케이션을 컴파일하고 검증합니다. 독립적으로 사용될 수 있고, 실행중인 톰캣 서버가 없어도 됩니다. 컴파일된 애플리케이션은 오직 관련된 톰캣 5.0.x버전의 서버에서만 실행됩니다. 다른 버전에서는 동작한다고 보장할 수 없습니다. 재스퍼에 의해 생성된 코드는 실행 컴포넌트에 의존하기 때문입니다. 또 하나 알아야 할 것은 이 compile 타겟은 웹 애플리케이션의 /WEB-INF/classes 폴더 안에 있는 모든 자바 소스는 자동으로 모두 컴파일 해 버린다는 것입니다.
  • deploy: (컴파일 되든 안되든) 웹 애플리케이션을 톰캣 서버로 배치합니다.
  • undeploy: 웹 애플리케이션을 제거.
  • start: 웹 애플리케이션을 시작.
  • reload: 웹 애플리케이션을 릴로드.
  • stop: 웹 애플리케이션을 정지.

The deployer package includes a ready to use Ant script, with the following targets:
compile (default): Compile and validate the web application. This can be used standalone, and does not need a running Tomcat server. The compiled application will only run on the associated Tomcat 5.0.x server release, and is not guaranteed to work on another Tomcat release, as the code generated by Jasper depends on its runtime component. It should also be noted that this target will also compile automatically any Java source file located in the /WEB-INF/classes folder of the web application.
deploy: Deploy a web application (compiled or not) to a Tomcat server
undeploy: Undeploy a web application
start: Start web application
reload: Reload web application
stop: Stop web application

다음 프로퍼티는 시스템 프로퍼티나 또는 디플로이어 패키지의 루트 폴더에 있는 deployer.properties 파일을 통해서 지정할 수 있습니다:

  • build: 기본적으로 사용되는 빌드 폴더는 ${build}/webapp${path} 입니다. compile 타겟의 실행이 마친 후, 웹 애플리케이션 WAR 파일은 ${build}/webapp${path}.war 에 만들어집니다.
  • webapp: 컴파일되고 검증되고, 압축이 풀린 웹 애플리케이션이 담길 폴더. 기본 폴더명은 myapp 입니다.
  • path: 웹 애플리케이션의 배치될 컨텍스트 경로. 기본값은 /myapp.
  • url: 실행중인 톰캣 서버의 매니저 웹애플리케이션에 접근할 수 있는 절대 URL. 여기를 통해서 웹 애플리케이션을 배치(설치) 또는 제거할 수 있습니다. 정해지지 않으면 디플로이어는 로컬호스트에서 돌아가는 톰캣인스턴스의 주소 http://localhost:8080/manager로 접근하려 할 것 입니다.
  • username: 톰캣 매니저 연결용 username.
  • password: 톰캣 매니저 연결용 password.

The following properties can be specified, either as system properties, or by using a deployer.properties file located in the root folder of the deployer package:
build: The build folder used will be, by default, ${build}/webapp${path}. After the end of the execution of the compile target, the web application WAR will be located at ${build}/webapp${path}.war.
webapp: Folder containing the expanded web application which will be compiled and validated. By default, the folder is myapp.
path: Deployed context path of the web application, by default /myapp.
url: Absolute URL to the manager web application of a running Tomcat server, which will be used to deploy and undeploy the web application. By default, the deployer will attempt to access a Tomcat instance running on localhost, at http://localhost:8080/manager.
username: Username to be used to connect to the Tomcat manager.
password: Password to be used to connect to the Tomcat manager.

from: http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

+ Recent posts