intellij tomcat war exploded
intellij ide에서는 내부 tomcat을 run할때
war : exploded 로 해놓으면 artifact를 war파일 상태로 배포하는대신
변경된 파일만 갱신하는 형식으로 소스코드와 리소스를 반영하기 때문에
보다 빠른 디버깅과 코드 생산을 도와줌.
intellij tomcat war
intellij ide에서는 내부 tomcat을 run할때
war로 해놓으면 artifact를 war파일 상태로 배포.
local 개발환경에서 보다는 server 환경으로 배포할때 사용함.
기대효과
적용 방법
build.gradle 파일에 다음 코드 추가
import java.text.SimpleDateFormat
def todayMonth = new SimpleDateFormat('yyyyMM').format(new Date())
war {
archiveFileName = "프로젝트명_${todayMonth}.war"
}
상단 tomcat 우클릭

deployment 탭 접근 후 기존 war 삭제

"+" 버튼 누른뒤 Artifact 클릭


Application context 재설정

intellij tomcat => run 실행

보다시피 build.gradle 파일에 작성된 규칙대로 war 폴더명이 생성 되었고
이 정책대로라면 매달 마지막으로 intellij tomcat을 run한 프로젝트 소스를 프로젝트폴더/build/libs/exploded 경로 에 백업하는 효과를 가짐




intellij 하단의 터미널에 작성
터미널과 동일
gradle build


만약 stack overflow 관련 에러 메세지가 나타난다면 build.gradle 파일에 다음과 같이 설정
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet') // 모든 Javadoc 경고를 무시
}
tasks.withType(JavaCompile) {
options.compilerArgs = ['-Xlint:none'] // 모든 컴파일 경고를 무시
options.encoding = 'UTF-8'
options.fork = true
options.forkOptions.jvmArgs = ['-Xss6m'] // 스택 크기를 늘려서 StackOverflowError 방지
}