3.프로젝트 세팅

강재영's avatar
Sep 26, 2024
3.프로젝트 세팅
 

1. spring project

notion image
 
 
 
notion image
 

2.build.gradle

plugins { id 'java' id 'org.springframework.boot' version '3.3.3' id 'io.spring.dependency-management' version '1.1.6' } group = 'shop.mtcoding' version = '0.0.1-SNAPSHOT' java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() // 아임포트 관련 maven {url 'https://jitpack.io'} } dependencies { implementation group: 'org.qlrm', name: 'qlrm', version: '4.0.1' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-mustache' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' implementation 'org.springframework.boot:spring-boot-starter-aop' implementation 'org.springframework.boot:spring-boot-starter-validation' runtimeOnly 'com.mysql:mysql-connector-j' // 아임포트 관련 // // https://mvnrepository.com/artifact/com.github.iamport/iamport-rest-client-java implementation group: 'com.github.iamport', name: 'iamport-rest-client-java', version: '0.2.22' // https://mvnrepository.com/artifact/com.squareup.retrofit2/adapter-rxjava2 implementation group: 'com.squareup.retrofit2', name: 'adapter-rxjava2', version: '2.9.0' // https://mvnrepository.com/artifact/com.google.code.gson/gson implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.3' // https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-gson implementation group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.3.0' } tasks.named('test') { useJUnitPlatform() }
 
 

3.properties

notion image
 

3.1 dev

# 1. UTF-8 ?? server.servlet.encoding.charset=UTF-8 server.servlet.encoding.force=true # 2. H2 ?????? ?? spring.datasource.driver-class-name=org.h2.Driver spring.datasource.url=jdbc:h2:mem:test spring.datasource.username=sa # 3. ?????? ?? spring.jpa.hibernate.ddl-auto=create spring.jpa.show-sql=true spring.jpa.defer-datasource-initialization=true # 4.Dummy spring.sql.init.data-locations=classpath:db/data.sql # 5. Mustache Setting spring.mustache.servlet.expose-request-attributes=true spring.mustache.servlet.expose-session-attributes=true # 6. Query format spring.jpa.properties.hibernate.format_sql=true # 7. OpenInView spring.jpa.open-in-view=false spring.jpa.properties.hibernate.default_batch_fetch_size=100
 

3.2 prod

# 1. UTF-8 server.servlet.encoding.charset=UTF-8 server.servlet.encoding.force=true # 2. H2 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/blogdb spring.datasource.username=root spring.datasource.password=root1234 # 3. Hibernate spring.jpa.hibernate.ddl-auto=none # 3. Mustache Setting spring.mustache.servlet.expose-request-attributes=true spring.mustache.servlet.expose-session-attributes=true # 4. OpenInView spring.jpa.open-in-view=false
 
Share article

강재영 블로그