맥북은 자바가 기본적으로 설치되어있다.
아래 익스텐션 두개만 설치하면 JVM, Tomcat 등 다양한 라이브러리를 기본적으로 설치해준다.
VSC Extension
- Extension Pack for Java
- Gradle for Java
먼저 프로젝트를 생성한다.
Generate 버튼을 누르면 zip파일이 다운로드되고 압축을 풀고 해당 폴더에서 vsc를 키면 된다.
8080포트에 기본적으로 서버가 잡힌다.
Build 하는 방법은 아래와 같다.
# 현재 폴더: Project
# build
./gradlew build
# build 삭제
./gradlew clean
# 다시 build
./gradlew clean build
아래는 Run 버튼 이외에 터미널에서 프로젝트를 실행하는 방법.
# 현재 폴더: Project/build/libs
# java 실행
ls
java -jar ~~~.jar
nodemon처럼 저장할 때 마다 서버를 재부팅하고 싶다면 아래처럼 세팅하자.
// build.gradle
dependencies{
...
compileOnly 'org.springframework.boot:spring-boot-devtools'
}
// application.properties
spring.devtools.livereload.enabled=true
참고) srping boot docs
https://docs.spring.io/spring-boot/docs/current/reference/html/
Spring Boot Reference Documentation
The reference documentation consists of the following sections: Legal Legal information. Getting Help Resources for getting help. Documentation Overview About the Documentation, First Steps, and more. Getting Started Introducing Spring Boot, System Require
docs.spring.io
'Server > Java' 카테고리의 다른 글
Java) JpaRepository - Rollback Test (0) | 2022.11.17 |
---|---|
Java) JpaRepository - MySQL Post method, Raw Query (0) | 2022.11.17 |
Java) JpaRepository - MySQL 데이터 가져오기 (0) | 2022.11.16 |
Java) AOP - TimeTrace 시간측정 (0) | 2022.11.16 |
Java) 컴포넌트 스캔으로 자동 DI 주입하기 (0) | 2022.11.16 |