生命周期配置未涵盖的插件执行:org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain [英] Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain

查看:101
本文介绍了生命周期配置未涵盖的插件执行:org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 m2e 构建一个 java 项目.我需要使用 JAVA VERSION 1.6 .所以我正在尝试配置工具链插件来实现它.通过参考以下链接.

I am using m2e to build a java project. I need to use JAVA VERSION 1.6 . So i am trying to configure toolchains plugin to achieve it. by referring the below link.

https://maven.apache.org/guides/mini/guide-using-toolchains.html

但是在 eclipse 中它会抛出以下错误.

But in eclipse it is throwing the below error.

生命周期配置未涵盖的插件执行:org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain(执行:默认,阶段:验证) pom.xml/Replenishment 行98 Maven项目构建生命周期映射问题

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (execution: default, phase: validate) pom.xml /Replenishment line 98 Maven Project Build Lifecycle Mapping Problem

我提到了 link 但我做到了没有得到适当的清晰度.下面是用于配置工具链插件的代码片段.

I referred the link but i did not get a proper clarity. Below is the code snippet used for configuring tool chains plugin.

在 pom.XML 中

IN pom.XML

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-toolchains-plugin</artifactId>
        <version>1.1</version>
        <lifecycleMappingMetadata>
               <pluginExecutions>
                  <pluginExecution>
                      <pluginExecutionFilter>
                          <groupId>
                              org.apache.maven.plugins
                          </groupId>
                          <artifactId>
                              maven-toolchains-plugin
                          </artifactId>
                          <versionRange>
                              [1.1,)
                          </versionRange>
                          <goals>
                              <goal>toolchain</goal>
                          </goals>
                      </pluginExecutionFilter>
                      <action>
                          <ignore></ignore>
                      </action>
                  </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
        <executions>
          <execution>
            <goals>
              <goal>toolchain</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <toolchains>
            <jdk>
              <version>1.6</version>
              <vendor>sun</vendor>
            </jdk>
          </toolchains>
        </configuration>
    </plugin>

和我的工具链.xml

<?xml version="1.0" encoding="UTF8"?>
<toolchains>
  <!-- JDK toolchains -->
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>1.6</version>
      <vendor>sun</vendor>
    </provides>
    <configuration>
      <jdkHome>D:\POC\jdk1.6.0_31</jdkHome>
    </configuration>
  </toolchain>

</toolchains>

推荐答案

更改我的 pom.xml 文件后,错误得到解决,如下所示.我们需要添加maven生命周期插件,然后在.

The error got resolved after changing my pom.xml file like below. We need to add the maven life cycle plugin and then include the metadata information in the .

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
        </plugin>
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <version>1.1</version>
                <executions>
                  <execution>
                    <goals>
                      <goal>toolchain</goal>
                    </goals>
                  </execution>
                </executions>
                <configuration>
                  <toolchains>
                    <jdk>
                      <version>1.6</version>
                      <vendor>sun</vendor>
                    </jdk>
                  </toolchains>
                </configuration>
            </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <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-toolchains-plugin
                          </artifactId>
                          <versionRange>
                              [1.1,)
                          </versionRange>
                          <goals>
                              <goal>toolchain</goal>
                          </goals>
                      </pluginExecutionFilter>
                      <action>
                          <ignore></ignore>
                      </action>
                  </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

这篇关于生命周期配置未涵盖的插件执行:org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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