[Spring] Spring Boot(1) - 프로젝트 생성하기

seonjeong·2023년 3월 4일
0

Spring

목록 보기
13/27
post-thumbnail

기본 환경

  • IDE : sts 4
  • spring : spring boot 3.0.4
  • java : 17

1. new -> spring starter project

: spring boot 기본정보 입력

2. pom.xml

: maven repository에서 dependency 추가

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

3. spring boot 실행

: Run As > Spring Boot App

4. 환경에 따른 설정

: application.properties에서 작성

ex) 포트번호 변경
-> 변경 후 다시 실행해보면 포트 번호가 8080에서 3000으로 변경된 것을 확인할 수 있다

5. 설정 파일 생성

@Configuration : 설정파일을 만들기 위한 애노테이션 or Bean을 등록하기 위한 애노테이션

profile
🦋개발 공부 기록🦋

0개의 댓글

관련 채용 정보