Data & MarTech/Google Cloud Platform

Plugin execution not covered by lifecycle configuration

Jason Nam 2015. 1. 27. 00:22
반응형

Google App Engine을 Maven Project로 변경하였을 때 아래와 같은 에러 메시지가 pom.xml에 뜬다.


[그림1] Lifecycle Mapping Error 발생시


Maven 을 실제 프로젝트에서 사용하는 소스를 처음 접했는데, (책 예제 따라하면서 한것 말고. ㅎㅎ)

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

'Plugin execution not covered by lifecycle configuration'

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

pom.xml 파일을 XML형태로 열어서 <build>나 <plugins> 태그를 검색하면 아래와 같은 코드가 있다. <build>가 여러개 검색된다면 꼭 아래와 같은 형태를 띈 <build>를 찾으면 된다. (아니면 가장 바깥쪽을 감싸고 있는 <build> 태그를 찾으면 된다.)

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

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

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

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


[그림2] pluginManagement 태그로 감싼 후 Lifecycle Mapping Error 상태


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

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

 


From Maven documentation:

pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one. However, this only configures plugins that are actually referenced within the plugins element in the children. The children have every right to override pluginManagement definitions.

출처 : http://maven.apache.org/pom.html#Plugin_Management


 

반응형