[ jar 빌드 ]

apply plugin: 'java'
@SpringBootApplication
public class Application {
   //jar
   public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
   }
}

 

[ war 빌드 ]

내장 tomcat 의 scope를 runtime 으로 바꿔준다

apply plugin: 'war'

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
}
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
   //war
   @Override
   protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
      return application.sources(Application.class);
   }

   public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
   }
}

 

 

반응형

'back' 카테고리의 다른 글

[Java] 일급콜렉션 : First Class Collection  (0) 2022.10.06
[TDD] 테스트주도개발  (0) 2022.10.04
JWT  (0) 2020.11.18

+ Recent posts