문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot [2018/04/03 13:10] kwon37xi [Date/Time Format] |
springframework:springboot [2018/09/14 13:05] kwon37xi [SpringBoot] |
||
---|---|---|---|
줄 2: | 줄 2: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
+ | * [[springframework: | ||
===== Dependency Version Override ===== | ===== Dependency Version Override ===== | ||
의존 라이브러리의 버전을 다른 것으로 바꾸고자 한다면 property를 변경하면 된다. | 의존 라이브러리의 버전을 다른 것으로 바꾸고자 한다면 property를 변경하면 된다. | ||
줄 12: | 줄 19: | ||
* [[https:// | * [[https:// | ||
- | ===== With JPA ===== | + | ===== JRebel SpringBoot / Gradle |
- | * 현재 Spring boot 버전에 | + | * [[https://www.javacodegeeks.com/2018/02/jrebel-gradle-spring-boot-app.html|JRebel for a Gradle Spring Boot App | Java Code Geeks - 2018]] |
- | * [[https:// | + | |
- | * 해결책은 naming strategy를 직접 지정해 줄 것< | + | |
- | // Hibernate 4 | + | |
- | spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy | + | |
- | // or | + | |
- | spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy | + | |
- | // Hibernate 5 | + | |
- | spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | + | |
+ | ===== DataSource ===== | ||
+ | * Default 말고 직접 '' | ||
+ | <code java> | ||
+ | import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; | ||
+ | @Bean | ||
+ | @ConfigurationProperties(prefix | ||
+ | public DataSource rubyDataSource() { | ||
+ | return DataSourceBuilder.create().type(org.apache.tomcat.jdbc.pool.DataSource.class).build(); | ||
+ | } | ||
</ | </ | ||
+ | * 위 예에서 설정값은 '' | ||
- | ===== JRebel SpringBoot / Gradle | + | ===== BootRun |
- | * [[https:// | + | ==== Debug Mode ==== |
+ | <code groovy> | ||
+ | bootRun { | ||
+ | if (project.hasProperty(" | ||
+ | jvmArgs = ["-agentlib: | ||
+ | } | ||
+ | } | ||
+ | // suspend=y는 JVM이 뜰 때 Remote Debugger가 접속될 때까지 기다린다. | ||
+ | // 실행 후 바로 종료하는 명령행 애플리케이션의 경우 무조건 y | ||
+ | </ | ||
- | ===== Date/Time Format ===== | + | <code sh> |
- | * [[http://www.popit.kr/rest-api-%eb%82%a0%ec%a7%9c%ec%8b%9c%ea%b0%84-%ed%91%9c%ed%98%84-%ec%a0%95%ed%95%98%ea%b8%b0/ | + | # -PbootDebug 프라퍼티를 지정하면 디버그 모드로 뜬다. |
- | * [[http:// | + | ./gradlew bootRun -PbootDebug |
- | * 1.x와 2.x 에서 동일 결과를 낼 수 있는 방식 지정할 것. | + | </ |
+ | |||
+ | ==== Application Arguments | ||
+ | * [[https://www.baeldung.com/spring-boot-command-line-arguments|Command-line Arguments in Spring Boot | Baeldung]] | ||
+ | <code groovy> | ||
+ | bootRun { | ||
+ | if (project.hasProperty(' | ||
+ | args project.args.split(',' | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | 위와 같이 | ||
+ | |||
+ | <code sh> | ||
+ | ./gradlew bootRun -Pargs=param1, | ||
+ | </ | ||
===== 참고 ===== | ===== 참고 ===== | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
- | * [[http:// | ||
* [[https:// | * [[https:// | ||
* [[http:// | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[https:// |