본문 바로가기
Back-end/JAVA & Spring

[Java] Maven 사용하는 스프링(이클립스) 프로젝트에서 'Plugin execution not covered by lifecycle configuration' 오류

by 꼬바리 2021. 6. 2.

pom.xml 파일에서 다음과 같은 에러가 있었다. (이클립스 사용)

'Plugin execution not covered by lifecycle configuration'

 

이 경우에 몇가지 해결법이 있는 것으로 아는데, 가장 간단한 방법이 <plugins> 태그 바깥쪽에 <pluginManagement> 태그를 감싸주는 것.

 

-before

<build>
    <plugins>
        <plugin> ... </plugin>
            ....
    </plugins>
</build>

위와 같은 코드가 있을 것이다.
이코드를 아래와 같이 <pluginManagement> 태그로 감싸주고

 

-after

<build>
    <pluginManagement>
        <plugins>
            <plugin> ... </plugin>
                ....
        </plugins>   
    
</pluginManagement>
</build>

저장해주면 pom.xml 파일은 더 이상 에러를 내지 않는다.

 

 

pluginManagement 태그는 동일한 플러그인(plugin)들을 나의 모든 프로젝트(자식 프로젝트) 내에서 공유하여 사용하기 위한 태그이다.

 

pluginManagement 태그는 부모(parent) pom.xml 파일에서만 정의되어 사용되며 자식(child) pom.xml에서 공통으로 사용할 Plugin들을 설정할 수 있다. 이렇게 부모 pom.xml 파일에 한 번 설정해 놓으면, 자식 pom.xml에 일일이 필요한 플러그인을 설정해 줄 필요가 없다.  

728x90

댓글