[Spring] Maven Wrapper

Maven Wrapper 란 Maven 환경에서 개발 시 Apache maven 프로젝트를 관리하는 주는 툴이다. 이것을 사용하면 매번 복잡한 개발환경을 구성할 필요 없이 어디서든 쉽게 개발할 수 있다.

Maven Wrapper 생성

Maven프로젝트 폴더 아래에서 아래 명령을 사용하면 쉽게 Maven Wrapper를 생성 할 수 있다.

mvn -N io.takari:maven:0.7.7:wrapper

명령어

#특정 프로파일로 실행
./mvnw -P[profile명]
#Test
./mvnw test
# Test skip
./mvnw -Dmaven.test.skip=true
#clean
./mvnw clean
#package, jar 파일 만듬
./mvnw package
#Install, 현재 폴더에 설치
./mvnw install
#test case 실행
./mvnw verify

Resource 파일

Maven 프로젝트에서 resources 폴더 하위 파일들은 컴파일 시에 jar 파일 안의 META-INF 폴더 하위로 위치 하게 된다. resource 파일만 업데이트 하려면 아래 명령을 사용하면 된다.

./mvnw process-resources

https://www.popit.kr/how-to-use-maven-wrapper/

https://reflectoring.io/maven-wrapper/

https://maven.apache.org/guides/getting-started/index.html

https://www.journaldev.com/33645/maven-commands-options-cheat-sheet

'Spring boot' 카테고리의 다른 글

[Spring] 코드에서 Active Profile 가져오기  (0) 2022.01.09
[Spring] Cache  (0) 2022.01.03
[Spring]JobRunr libary 사용  (0) 2021.12.19
[Spring] EJB, POJO 그리고 Spring  (0) 2021.12.12
[Spring] Kotllin + Spring boot 시작하기  (0) 2021.12.08