Programing

수명주기 구성에 포함되지 않는 플러그인 실행 (JBossas 7 EAR 아키 타입)

crosscheck 2020. 7. 10. 08:01
반응형

수명주기 구성에 포함되지 않는 플러그인 실행 (JBossas 7 EAR 아키 타입)


Maven M2E Plugin 1.0.100과 함께 Eclipse 3.7 Indigo를 사용하고 있습니다.

JBoss 7.x JavaEE 6 EAR 아키타 입을 사용하면 EAR 용 pom에서이 오류가 발생합니다.

라이프 사이클 구성에서 다루지 않는 플러그인 실행 : org.apache.maven.plugins : maven-ear-plugin : 2.6 : generate-application-xml (실행 : default-generate-application-xml, 단계 : generate-resources)

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-ear-plugin</artifactId>
   <version>2.6</version>
   <configuration>
      <!-- Tell Maven we are using Java EE 6 -->
      <version>6</version>
      <!-- Use Java EE ear libraries as needed. Java EE ear libraries 
                  are in easy way to package any libraries needed in the ear, and automatically 
                  have any modules (EJB-JARs and WARs) use them -->
      <defaultLibBundleDir>lib</defaultLibBundleDir>
      <modules></modules>
   </configuration>
<plugin>

이것은 얼마 전에 소개 된 M2E 플러그인의 "기능"입니다. JBoss EAR 플러그인과 직접 관련이 없지만 대부분의 다른 Maven 플러그인에서도 발생합니다.

당신이 당신에 정의 된 플러그인 실행이있는 경우 pom(의 실행 등으로 maven-ear-plugin:generate-application-xml), 당신은 또한 플러그인 실행이 무시에 의해 실행되어야한다 예를 들어, 빌드가 Eclipse에서 실행될 때 무엇을해야 하는지를 M2E를 알려줍니다 M2E에 대한 추가 설정 정보를 추가 할 필요가 M2E, 증분 빌드에도 수행해야합니다. 해당 정보가 누락 된 경우 M2E는 다음 오류 메시지를 표시하여 이에 대해 불평합니다.

"라이프 사이클 구성에서 다루지 않는 플러그인 실행"

자세한 설명과 오류를 없애기 위해 pom에 추가해야하는 샘플 구성은 여기를 참조하십시오.

https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html


어쨌든 너무 늦었지만 내 솔루션은 Eclipse에서 오류 메시지를 마우스 오른쪽 버튼으로 클릭하고 빠른 수정 >> 그러한 오류가있는 모든 pom에 대해 무시를 선택하는 것입니다.


Eclipse는 점진적 빌드 개념을 가지고 있으며, 이는 많은 시간을 절약하므로 매우 유용합니다.

이것이 어떻게 유용합니까

방금 단일 .java 파일을 변경했다고 가정하십시오. 증분 빌더는 모든 것을 다시 컴파일하지 않고도 코드를 컴파일 할 수 있습니다 (더 많은 시간이 소요됨).

이제 Maven 플러그인의 문제점

maven 플러그인의 대부분은 증분 빌드 용으로 설계되지 않았으므로 m2e에 문제가 발생합니다. m2e는 플러그인 목표가 중요한 것인지 또는 관련이 없는지 알 수 없습니다. 단일 파일이 변경 될 때 모든 플러그인을 실행하면 많은 시간이 걸립니다.

이것이 m2e가 메타 데이터 정보에 의존하여 실행 처리 방법을 파악하는 이유입니다. m2e는이 메타 데이터 정보를 제공하기 위해 다양한 옵션을 제시했으며 선호 순서는 다음과 같습니다 (최고에서 최하)

  1. 프로젝트의 pom.xml 파일
  2. 부모, 조부모 등 pom.xml 파일
  3. [m2e 1.2+] 작업 공간 환경 설정
  4. 설치된 m2e 확장
  5. [m2e 1.1+] 메이븐 플러그인에서 제공하는 라이프 사이클 매핑 메타 데이터
  6. m2e와 함께 제공되는 기본 수명주기 매핑 메타 데이터

1,2는 pom 파일의 태그 또는 상위 항목의 pluginManagement 섹션을 지정하는 것을 말합니다. M2E는이 구성을 읽고 프로젝트를 구성합니다. 스 니펫 아래 에서 m2e에 yuicompressor-maven-plugin의 목표 jslintcompress목표 를 무시하도록 지시합니다.

<pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>net.alchim31.maven</groupId>
                                    <artifactId>yuicompressor-maven-plugin</artifactId>
                                    <versionRange>[1.0,)</versionRange>
                                    <goals>
                                        <goal>compress</goal>
                                        <goal>jslint</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

3) In case you don't prefer polluting your pom file with this metadata, you can store this in an external XML file(option 3). Below is a sample mapping file which instructs m2e to ignore the jslint and compress goals of the yuicompressor-maven-plugin

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
                <versionRange>[1.0,)</versionRange>
                <goals>
                    <goal>compress</goal>
                    <goal>jslint</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <ignore/>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

4)이 3 가지 옵션이 마음에 들지 않으면 maven 플러그인에 m2e 커넥터 (확장)를 사용할 수 있습니다. 커넥터는 m2e에 메타 데이터를 제공합니다. 링크 에서 커넥터 내 메타 데이터 정보의 예를 볼 수 있습니다 . 메타 데이터가 구성자를 참조한다는 것을 알았을 것입니다. 이것은 단순히 m2e가 확장 작성자가 제공 한 특정 Java 클래스에 책임을 위임한다는 것을 의미합니다. 컨 피규 레이터는 프로젝트를 구성하고 (예 : 추가 소스 폴더 추가 등) 증분 빌드 중 실제 maven 플러그인을 실행할지 여부를 결정할 수 있습니다 ( 컨 피규 레이터 내에서 제대로 관리되지 않으면, 무한한 프로젝트 빌드로 이어질 수 있습니다)

구성자 ( link1 , link2 ) 의 예는이 링크를 참조하십시오 . 따라서 플러그인이 외부 커넥터를 통해 관리 될 수있는 경우 플러그인을 설치할 수 있습니다. m2e는 다른 개발자가 제공 한 이러한 커넥터 목록을 유지 관리합니다.이를 발견 카탈로그라고합니다. 옵션 (1-6) 중 하나를 통해 실행할 수명주기 매핑 메타 데이터가없고 검색 카탈로그에 실행을 관리 할 수있는 확장명이있는 경우 m2e는 커넥터를 설치하라는 메시지를 표시합니다.

아래 이미지는 m2e가 build-helper-maven-plugin 용 커넥터를 설치하라는 메시지를 표시하는 방법을 보여줍니다. 감지 카탈로그에서 제안 된 설치 커넥터.

5)m2e encourages the plugin authors to support incremental build and supply lifecycle mapping within the maven-plugin itself.This would mean that users won't have to use any additional lifecycle mappings or connectors.Some plugin authors have already implemented this

6) By default m2e holds the lifecycle mapping metadata for most of the commonly used plugins like the maven-compiler-plugin and many others.

Now back to the question :You can probably just provide an ignore life cycle mapping in 1, 2 or 3 for that specific goal which is creating trouble for you.


A good workaround to remind you that m2e could be better configured, without the project inheriting a false positive error marker, is to just downgrade those errors to warnings:

Window -> Preferences -> Maven -> Errors/Warnings -> Plugin execution not covered by lifecycle configuration = Warning


I tried to execute specific plugging right after clean up i.e. post-clean (default is clean phase). This worked for me with eclipse indigo. Just added post-clean resolved the problem for me.

<executions>
  <execution>
    <configuration>
    </configuration>
   <phase>post-clean</phase>
    <goals>
      <goal>update-widgetset</goal>
    </goals>
  </execution>
</executions> 

I was able to resolve the same problem with maven-antrun-plugin and jaxb2-maven-plugin in Eclipse Kepler 4.3 by appying this solution: http://wiki.eclipse.org/M2E_plugin_execution_not_covered#Eclipse_4.2_add_default_mapping
So the content of my %elipse_workspace_name%/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
  <pluginExecutions>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <versionRange>1.3</versionRange>
        <goals>
          <goal>run</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
    <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <versionRange>1.2</versionRange>
        <goals>
          <goal>xjc</goal>
        </goals>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
  </pluginExecutions>
</lifecycleMappingMetadata>

*Had to restart Eclipse to see the errors gone.


As of Maven Eclipse (m2e) version 0.12 all Maven life-cycle goals must map to an installed m2e extension. In this case, the maven-ear-plugin had an-unmapped goal default-generate-application-xml.

You can exclude un-mapped life-cycle goals by simply following the instructions here:

https://wiki.eclipse.org/M2E_plugin_execution_not_covered

Alternatively, simply right-click on the error message in Eclipse and choosing Quick Fix -> Ignore for every pom with such errors.

You should be careful when ignoring life-cycle goals: typically goals do something useful and if you configure them to be ignored in Eclipse you may miss important build steps. You might also want to consider adding support to the Maven Eclipse EAR extension for the unmapped life-cycle goal.


With the mechanism explained in the answer of Jan I have instructed the m2e pluging to ignore the goal "generate-application-xml". This gets rid of the error and seems to work since m2e creates application.xml.

So basically the error forced us to decide which mechanism is in charge for generating application.xml when the Maven build runs inside Eclipse under the control of the m2e plugin. And we have decided that m2e is in charge.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <version>6</version>
                <defaultLibBundleDir>lib</defaultLibBundleDir>
            </configuration>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            **<!-- This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-ear-plugin</artifactId>
                                    <versionRange>[2.1,)</versionRange>
                                    <goals>
                                        <goal>generate-application-xml</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>**
        </plugins>
    </pluginManagement>
</build>

You need to understand the content in M2E_plugin_execution_not_covered and follow the steps mentioned below:

  • Pick org.eclipse.m2e.lifecyclemapping.defaults jar from the eclipse plugin folder
  • Extract it and open lifecycle-mapping-metadata.xml where you can find all the pluginExecutions.
  • Add the pluginExecutions of your plugins which are shown as errors with <ignore/> under <action> tags.

eg: for write-project-properties error, add this snippet under the <pluginExecutions> section of the lifecycle-mapping-metadata.xml file:

 <pluginExecution>
    <pluginExecutionFilter>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>properties-maven-plugin</artifactId>
       <versionRange>1.0-alpha-2</versionRange>
       <goals>
         <goal>write-project-properties</goal>
       </goals>
    </pluginExecutionFilter>
     <action>
       <ignore />
     </action>
   </pluginExecution>
  • Replace that XML file in the JAR
  • Replace the updated JAR in Eclipse's plugin folder
  • Restart Eclipse

You should see no errors in the future for any project.


Even though the question is too old, but I would like to share the solution that worked for me because I already checked everything when it comes to this error. It was a pain, I spent two days trying and at the end the solution was:

update the M2e plugin in eclipse

clean and build again

참고URL : https://stackoverflow.com/questions/9142533/plugin-execution-not-covered-by-lifecycle-configuration-jbossas-7-ear-archetype

반응형