Backend combines components such as kotlin, spring-boot, jpa, webmvc, junit, mockk
프로젝트 build 및 run 을 위해 먼저 jdk-17 버전을 준비합니다.
java -version
# sdk 패키지 매니저를 이용 한다면 현재 java 버전 확인 및 버전 변경을 할 수 있습니다.
sdk current java
# 17 버전이 없다면 설치 가능
# sdk install java <JDK_17_Version>
sdk default java <JDK_17_Version>
mvn clean package -DskipTests=true
mvn spring-boot:run -DskipTests=true
curl -v -L -X GET http://localhost:8080/api/v1/users/query
curl -v -L -X POST 'http://localhost:8080/api/v1/users' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}' \
--data-raw '{
"firstName": "scott2",
"lastName": "pines",
"email": "scott2@pines.io",
"role": "Manager",
"title": "MR",
"usercode": "scott21234"
}'
curl -v -L -X GET 'http://localhost:8080/api/v1/users' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}'
curl -v -L -X GET 'http://localhost:8080/api/v1/users/1' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}'
curl -v -L -X PUT 'http://localhost:8080/api/v1/users/3' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}' \
--data-raw '{
"id": 3,
"firstName": "Banana",
"lastName": "Fruit",
"email": "banana.fruit@farm.io",
"role": "Admin",
"title": "Mr",
"usercode": "banana1234"
}'
curl -v -L -X GET 'http://localhost:8080/api/v1/users/query?lastName=Fruit&title=mr&email=farm&role=manager' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}'
curl -v -L -X DELETE 'http://localhost:8080/api/v1/users/4' \
-H 'Content-Type: application/json' -H 'Authorization: Bearer {token}'
docker-compose -f ./cicd/docker/docker-compose-mysql.yaml up -d
# Listen port 확인 (by netcat)
# nc -vc localhost 53306
docker-compose -f ./cicd/docker/docker-compose-h2.yaml up -d
# Listen port 확인 (by netcat)
# nc -vc localhost 1521
mvn clean package -DskipTests=true
docker build -t symplesims/user-service:loc-1.0 -f ./cicd/docker/Dockerfile .
### Docker Service UP
docker-compose -f ./cicd/docker/docker-compose.yaml up -d
# with profile
# docker-compose -f ./cicd/docker/docker-compose.yaml run user-service -e SPRING_PROFILE=dev
# Down
# docker-compose -f ./cicd/docker/docker-compose.yaml down
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Rest Repositories
- Spring Web
- Spring Data JPA
The following guides illustrate how to use some features concretely: