Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slowhigh/spring-boot-test
https://github.com/slowhigh/spring-boot-test
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/slowhigh/spring-boot-test
- Owner: slowhigh
- License: mit
- Created: 2024-08-28T06:32:47.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-19T09:22:22.000Z (about 2 months ago)
- Last Synced: 2024-10-02T09:32:34.164Z (about 1 month ago)
- Language: Java
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spring-boot-test
- Environment
- Project: Gradle-Kotlin
- Language: Java
- Spring Boot: 3.3.3
- Packaging: Jar
- Java: 22- Command
```sh
> ./gradlew bootRun
> ./gradlew test> ./gradlew build
```
- Hot Reload
- terminal 1
```sh
> ./gradlew build --continuous
```
- terminal 2
```sh
> ./gradlew bootRun
```- Spring의 import static 구문은 자동으로 생성되지 않는다
```java
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
```- build.gradle.kts에 dependency 추가 후 build.gradle.kts 클릭 후 "Reload Projects" Click or Shift+Alt+U
- build 시 생성되는 jar의 파일 이름 설정 (./build/libs/cloudnote-0.0.1.jar)
- `./settings.gradle.kts` 파일 내 `rootProject.name` 항목 수정 (rootProject.name = "cloudnote")
- `./build.gradle.kts` 파일 내 `version` 항목 수정 (version = "0.0.1")- docker 파일 생성
```sh
$ docker build --build-arg JAR_FILE=build/libs/\*.jar -t slowhigh/cloudnote .$ docker run -d --name rest-service -p 8080:8080 slowhigh/cloudnote
```