사용자 도구

사이트 도구


springframework:springboot

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
springframework:springboot [2018/09/14 13:05]
kwon37xi [SpringBoot]
springframework:springboot [2019/04/05 15:21]
kwon37xi
줄 10: 줄 10:
   * [[springframework:springboot:batch|SpringBoot와 SpringBatch]]   * [[springframework:springboot:batch|SpringBoot와 SpringBatch]]
   * [[springframework:springboot:springboot_admin|SpringBoot Admin]]   * [[springframework:springboot:springboot_admin|SpringBoot Admin]]
-===== Dependency Version Override ===== +  * [[springframework:springboot:gradle|SpringBoot and Gradle]] 
-의존 라이브러리의 버전을 다른 것으로 바꾸고자 한다면 property를 변경하면 된다+  * [[springframework:springboot:test|SpringBoot Test]] 
-<code groovy+  * [[springframework:springboot:springboot_cli|SpringBoot CLI]] 
-// 하이버네이트 버전 + 
-ext['hibernate.version'] = '5.2.14.Final'+===== @EnableAutoConfiguration ===== 
 +  * [[https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/EnableAutoConfiguration.html|@EnableAutoConfiguration]] 
 +  * 특정 Auto Configuration 방지<code java
 +@EnableAutoConfiguration(exclude = { 
 +    DataSourceAutoConfiguration.class, 
 +    DataSourceTransactionManagerAutoConfiguration.class, 
 +    HibernateJpaAutoConfiguration.class})
 </code> </code>
- +  * [[https://www.baeldung.com/spring-boot-custom-auto-configuration|A Custom Auto-Configuration with Spring Boot Baeldung]]
-  * [[https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-dependencies/pom.xml|spring boot dependencies pom.xml]] 여기서 버전 프라퍼티 목록을 알 수 있다.+
  
 ===== JRebel SpringBoot / Gradle ===== ===== JRebel SpringBoot / Gradle =====
   * [[https://www.javacodegeeks.com/2018/02/jrebel-gradle-spring-boot-app.html|JRebel for a Gradle Spring Boot App | Java Code Geeks - 2018]]   * [[https://www.javacodegeeks.com/2018/02/jrebel-gradle-spring-boot-app.html|JRebel for a Gradle Spring Boot App | Java Code Geeks - 2018]]
- 
- 
  
 ===== DataSource ===== ===== DataSource =====
줄 36: 줄 39:
   * 위 예에서 설정값은 ''my.datasource.*''로 구성한다. [[java:database:hikaricp|HikariCP]] 등 다른 구현체를 사용할 수도 있다.   * 위 예에서 설정값은 ''my.datasource.*''로 구성한다. [[java:database:hikaricp|HikariCP]] 등 다른 구현체를 사용할 수도 있다.
  
-===== BootRun ===== +==== SpringApplicationRunListener ==== 
-==== Debug Mode ==== +  [[https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/SpringApplicationRunListener.html|SpringApplicationRunListener]] 
-<code groovy> +  * SpringBoot 딩중 벤트를 받아 처리한다.
-bootRun { +
-    if (project.hasProperty("bootDebug")) { +
-        jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"+
-    } +
-+
- +
-// suspend=y는 JVM이 뜰 때 Remote Debugger가 접속될 때까지 기다린다. +
-// 실행 후 바로 종료하는 명령행 애플리케션의 경우 무조건 y +
-</code> +
- +
-<code sh> +
-# -PbootDebug 프라퍼티를 지정하면 디버그 모드로 뜬다. +
-./gradlew bootRun -PbootDebug +
-</code>+
  
-==== Application Arguments ==== +===== SpringBoot WebMVC 정적 리소스(static resource) ===== 
-  * [[https://www.baeldung.com/spring-boot-command-line-arguments|Command-line Arguments in Spring Boot | Baeldung]] +  * ''/src/main/META-INF/resources'' 
-<code groovy+  * jar 애플리케이션을 실행한 디렉토리 하위의 ''public/'' 디렉토리 
-bootRun +  * ''WebMvcConfigurerAdapter.addResourceHandlers'' 오버라이드하여 직접 지정<code java
-    if (project.hasProperty('args')) { +@Configuration 
-        args project.args.split(',')+public class StaticResourceConfig extends WebMvcConfigurerAdapter 
 +    @Override 
 +    public void addResourceHandlers(ResourceHandlerRegistry registry) { 
 +        registry.addResourceHandler("/static/**").addResourceLocations("file:/var/www/html");
     }     }
 } }
 </code> </code>
  
-위와 같이 설정하고, 아래와 같은 형태로 실행한다. 
- 
-<code sh> 
-./gradlew bootRun -Pargs=param1,param2,... 
-</code> 
 ===== 참고 ===== ===== 참고 =====
   * [[http://andromedarabbit.net/wp/spring-boot%ec%97%90%ec%84%9c-spring-framework-%eb%b2%84%ec%a0%84-%ec%a7%80%ec%a0%95%ed%95%98%ea%b8%b0/|Spring Boot에서 Spring Framework 버전 지정하기]]   * [[http://andromedarabbit.net/wp/spring-boot%ec%97%90%ec%84%9c-spring-framework-%eb%b2%84%ec%a0%84-%ec%a7%80%ec%a0%95%ed%95%98%ea%b8%b0/|Spring Boot에서 Spring Framework 버전 지정하기]]
springframework/springboot.txt · 마지막으로 수정됨: 2022/10/26 10:14 저자 kwon37xi