오류일지

[오류일지] No goals have been specified for this build (Maven)

개발로 먹고 살자 2022. 2. 28. 14:47

spring에서 maven을 빌드 하는데 오류가 발생했다.

 

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

 

확인을 해보니 빌드의 목표가 지정되지 않아 생기는 오류였다.

 

두 가지 방법으로 해결할 수 있다.

 

Build - Goals에 install 작성

빌드 시 Goals에 install을 작성해주면 빌드가 정상적으로 작동한다.

 

 

pom.xml - build에 추가

pom.xml 의 build에 추가한다.

<defaultGoal>install</defaultGoal>