Eclipse Maven错误插件执行不被生命周期配置所覆盖: [英] Eclipse Maven Error Plugin execution not covered by lifecycle configuration:

查看:284
本文介绍了Eclipse Maven错误插件执行不被生命周期配置所覆盖:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在Windows 7上使用Eclipse Juno与Maven 3.0.5。该项目以前在Windows XP中,我已经转移到Windows 7 64位机器。我复制了我的Eclipse Spring 3,Hibernate 4和JSF 2.0项目,当我尝试编译我收到以下错误

 插件执行不被生命周期配置覆盖:
org.bsc.maven:maven-processor-plugin:2.0.6:process(execution:process,phase:
generate-sources)

我尝试如这个线程通过在Eclipse.ini文件中添加以下内容,但是没有解决问题。

  -vm 
c:\Program Files\Java\jdk1.7.0_21\jre\bin\server\jvm。 dll

尝试建立maven安装和清洁,但问题仍然存在。



我如何解决这个问题?任何帮助是非常可观的。



感谢



Maven片段

 < plugins> 

< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< configuration>
< source> 1.6< / source>
< target> 1.6< / target>
< compilerArgument> -proc:none< / compilerArgument>
< / configuration>
< / plugin>
< plugin>
< groupId> org.bsc.maven< / groupId>
< artifactId> maven-processor-plugin< / artifactId>
< version> 2.0.6< / version>
<执行>
< execution>
< id>进程< / id>
< goals>
< goal>进程< / goal>
< / goals>
< phase> generate-sources< / phase>
< configuration>
<! - 源输出目录 - >
< outputDirectory> target / metamodel< / outputDirectory>
< / configuration>
< / execution>
< / executions>
< / plugin>
< / plugins>


解决方案

更新的m2e版本如果Maven插件不提供m2e生命周期映射。较新的插件提供商通过其JAR中的文件 META-INF / m2e / lifecycle-mapping-metadata.xml 进行映射。如果此文件不存在,则Eclipse会抱怨。



通过为POM添加旧插件的生命周期映射,可能会降低这些投诉。在给定的示例中,此映射在配置文件中完成,当配置文件在Eclipse中运行时(m2e.version属性已设置),该配置文件会自动激活,并且在正常的maven构建完成时,该配置文件不起作用。

 <个人资料> 
<个人资料>
< id> m2e< / id>
< activate>
< property>
< name> m2e.version< / name>
< / property>
< / activation>
< build>
< pluginManagement>
< plugins>
< plugin>
< groupId> org.eclipse.m2e< / groupId>
< artifactId>生命周期映射< / artifactId>
< version> 1.0.0< / version>
< configuration>
< lifecycleMappingMetadata>
< pluginExecutions>
< pluginExecution>
< pluginExecutionFilter>
< groupId> org.bsc.maven< / groupId>
< artifactId> maven-processor-plugin< / artifactId>
< versionRange> [2.0.6,)< / versionRange>
< goals>
< goal>进程< / goal>
< / goals>
< / pluginExecutionFilter>
< action>
< ignore />
< / action>
< / pluginExecution>
< / pluginExecutions>
< / lifecycleMappingMetadata>
< / configuration>
< / plugin>
< / plugins>
< / pluginManagement>
< / build>
< / profile>

上面的示例禁用了Eclipse构建中的插件。也可以通过指定< execute /> 作为动作来实现。



请注意, em> pluginExecutionFilter 必须匹配插件和您要映射的插件的目标。可以指定多个 pluginExecution 元素来映射不同的插件。


I am using Eclipse Juno with Maven 3.0.5 on Windows 7. The project was previously on Windows XP and I have moved to Windows 7 64 bit machine.

I have copied my Eclipse Spring 3, Hibernate 4 and JSF 2.0 project and when I try to compile I am getting the following error

Plugin execution not covered by lifecycle configuration: 
org.bsc.maven:maven-processor-plugin:2.0.6:process (execution: process, phase: 
generate-sources)

I tried as mentioned in this thread by adding the following in Eclipse.ini file, however it didn't solve the issue.

-vm
c:\Program Files\Java\jdk1.7.0_21\jre\bin\server\jvm.dll

Tried building maven install and clean, but problem still persists.

How can I resolve this issue? Any help is highly appreciable.

Thanks

Maven snippet

<plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>              
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-proc:none</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>2.0.6</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <!-- source output directory -->
                            <outputDirectory>target/metamodel</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

解决方案

Newer versions of m2e complain if a Maven plugin does not provide a m2e lifecycle mapping. Newer plugins provider such a mapping via the file META-INF/m2e/lifecycle-mapping-metadata.xml in their JAR. If this file is not present, then Eclipse complains.

It is possible quite down these complaints by adding a lifecycle mapping for older plugins to your POM. In the given example, this mapping is done inside a profile which is automatically activated when a build is running in Eclipse (m2e.version property is set) and it is not active when a regular maven build is done.

<profiles>
  <profile>
    <id>m2e</id>
    <activation>
      <property>
        <name>m2e.version</name>
      </property>
    </activation>
    <build>
      <pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
              <lifecycleMappingMetadata>
                <pluginExecutions>
                  <pluginExecution>
                    <pluginExecutionFilter>
                      <groupId>org.bsc.maven</groupId>
                      <artifactId>maven-processor-plugin</artifactId>
                      <versionRange>[2.0.6,)</versionRange>
                      <goals>
                        <goal>process</goal>
                      </goals>
                    </pluginExecutionFilter>
                    <action>
                      <ignore />
                    </action>
                  </pluginExecution>
                </pluginExecutions>
              </lifecycleMappingMetadata>
            </configuration>
          </plugin>         
        </plugins>
      </pluginManagement>
    </build>
  </profile>

The example above disables the plugin in Eclipse builds. It is also possible enable it by specifying <execute /> as action .

Mind that the settings under pluginExecutionFilter must match the plugin and the goals of the plugin that you wish to map. Multiple pluginExecution elements can be specified to map different plugins.

这篇关于Eclipse Maven错误插件执行不被生命周期配置所覆盖:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆