문서의 이전 판입니다!
apply plugin: 'tomcat'
buildscript { repositories { add(new org.apache.ivy.plugins.resolver.URLResolver()) { name = 'GitHub' addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]' } } dependencies { classpath 'bmuschko:gradle-tomcat-plugin:0.9.5' } } repositories { mavenCentral() } // For Tomcat 6 dependencies { def tomcatVersion = '6.0.29' tomcat "org.apache.tomcat:catalina:${tomcatVersion}", "org.apache.tomcat:coyote:${tomcatVersion}", "org.apache.tomcat:jasper:${tomcatVersion}" } // For Tomcat 7 dependencies { def tomcatVersion = '7.0.11' tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' } }
tomcatRun
: 압축풀린 웹 애플리케이션용 톰캣 인스턴스를 실행한다.tomcatRunWar
: 톰캣 인스턴스를 실행하면서 WAR를 배포한다.tomcatStop
: 톰캣 인스턴스를 종료한다.tomcatJasper
: JSP 컴파일러로 JSP 페이지를 java 소스로 변환한다.tomcatRun { httpPort = 8090 httpsPort = 8091 enableSSL = true URIEncoding = 'utf-8' contextPath = '' configFile = file('context.xml') // 기본값 src/main/webapp/META-INF/context.xml } // tomcatRun과 tomcatRunWar 공통 설정 [tomcatRun, tomcatRunWar]*.configFile = file('context.xml')
jasper { validateXml = true uriroot = 'webapp' // 웹 애플리케이션 루트 디렉토리 기본 src/main/webapp compilerSourceVM = '1.6' compilerTargetVM = '1.6' javaEncoding = 'utf-8' // 생성된 Java 소스 파일 인코딩 webXmlFragment = file("$webAppDir/WEB-INF/generated_web.xml") outputDir = file("$webAppDir/WEB-INF/src") }