生命周期配置maven错误未涵盖插件执行

时间:2023-01-25 15:06:10

i imported an existing maven project but i'm getting some errors in the pom.xml :

我导入了一个现有的maven项目但是我在pom.xml中遇到了一些错误:

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-

 compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml 

 /org.squashtest.csp.tools.unittest line 50 Maven Project Build Lifecycle Mapping Problem

but i can't understand why ,

但我不明白为什么,

Here's the pom.xml :

这是pom.xml:

 <?xml version="1.0"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org  
  /2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   
  http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
<parent>
    <artifactId>squashtest-csp-tools</artifactId>
    <groupId>org.squashtest.tm</groupId>
    <version>1.2.0.RELEASE</version>
</parent>
<artifactId>org.squashtest.csp.tools.unittest</artifactId>
<name>Squashtest CSP - Tools module - Unit tests library</name>
<description>Library  of classes used for unit-testing other Squashtest        
     components</description>

<dependencies>
    <!-- ====== GROOVY ====== -->
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <scope>compile</scope>
    </dependency>
    <!-- ====== /GROOVY ====== -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>org.squashtest.org.hibernate.core</artifactId>
        <version>${hibernate.version}</version>
        <scope>compile</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.unitils</groupId>
        <artifactId>unitils-database</artifactId>
        <version>3.1</version>
        <scope>compile</scope>
        <optional>true</optional>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-nop</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
<build>
    <sourceDirectory>src/main/groovy</sourceDirectory>
    <testSourceDirectory>src/test/groovy</testSourceDirectory>
    <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <executions><execution></execution></executions>
      <version>2.3.2</version>
      </plugin> 
    </plugins>
 </build>
</project>

Thank you in advance

先谢谢你

4 个解决方案

#1


25  

This is an issue with Groovy maven configuration. More specifically, m2e connector issues which are, generally speaking, a nightmare. This link contains good info about the m2e connector mess.

这是Groovy maven配置的问题。更具体地说,m2e连接器问题,一般来说,这是一场噩梦。此链接包含有关m2e连接器混乱的良好信息。

Summary

To fix this, you can grab the m2e connector that springsource provides.

要解决此问题,您可以获取springource提供的m2e连接器。

http://dist.springsource.org/release/GRECLIPSE/e4.2/

http://dist.springsource.org/release/GRECLIPSE/e4.2/

Details

To use it:

要使用它:

  1. Click Help > Install new software...
  2. 单击帮助>安装新软件...
  3. Paste the URL above in the "Work With:" field
  4. 将上面的URL粘贴到“处理方式:”字段中
  5. Expand "m2e Configurator for Groovy-Eclipse"
  6. 展开“用于Groovy-Eclipse的m2e配置器”
  7. Choose the first option "Groovy-Eclipse m2e Integration" and install it
  8. 选择第一个选项“Groovy-Eclipse m2e Integration”并安装它

生命周期配置maven错误未涵盖插件执行

I would also recommend installing the "Groovy/Grails Tool Suite for Eclipse" (GGTS) from the Eclipse Marketplace. I just did both of these (installing GGTS then the connector) in Eclipse Kepler and it solved the exact issue you had, above. This fix also works in Juno.

我还建议从Eclipse Marketplace安装“Groovy / Grails Tool Suite for Eclipse”(GGTS)。我刚刚在Eclipse Kepler中完成了这两个(在插件中安装GGTS),它解决了上面的确切问题。此修复程序也适用于Juno。

#2


0  

In Maven there are few things need to check before this error.

在Maven中,在此错误之前需要检查的事情很少。

  1. Are you able to download the jars from .m2 Repository? -> For this Just delete the repository folder under .m2 Folder and try to update the Maven projects. Then you can see the new Repository folder under .m2 folder. -> Check all the maven-plugin jars are came under org/apache/maven

    你能从.m2存储库下载罐子吗? - >为此只需删除.m2文件夹下的存储库文件夹并尝试更新Maven项目。然后,您可以在.m2文件夹下看到新的Repository文件夹。 - >检查所有的maven-plugin jar都在org / apache / maven下

  2. Check are you able to open the Repository url what ever you mentioned in Settings.xml file -> Open ths url in any browser and check whether are you able to open or not.

    检查是否能够在Settings.xml文件中打开存储库url - >在任何浏览器中打开网址并检查是否能够打开。

  3. Some times thrid party repository jars might be corrupted. -> This will take care by thrid party persons -> Ex: if you are pointing to Nexus repository, they have to upload the required maven jars once again. Some times while uploading the jars might be corrupt.

    有时候第三方存储库jar可能已损坏。 - >这将由第三方人员照顾 - >例如:如果你指向Nexus存储库,他们必须再次上传所需的maven jar。有时上传罐子可能会损坏。

#3


0  

What worked for me was to install the M2E Groovy-Eclipse integration but also to add more configuration to the maven compiler plugin in order to work with java and groovy classes:

对我有用的是安装M2E Groovy-Eclipse集成,但也为maven编译器插件添加更多配置,以便使用java和groovy类:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
       <compilerId>groovy-eclipse-compiler</compilerId>
       <source>1.7</source>
           <target>1.7</target>
    </configuration>
    <dependencies>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-compiler</artifactId>
                    <version>2.8.0-01</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-batch</artifactId>
                    <version>2.1.8-01</version>
                </dependency>
    </dependencies>
</plugin>

#4


0  

I had a similar problem. Eclipse said

我有类似的问题。 Eclipse说

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle (execution: default, phase: validate)

生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle(执行:默认,阶段:验证)

After removed checkstyle, there have been other similar problems.

删除checkstyle后,还有其他类似的问题。

To solve it, I click the quick fixes option: "Discover new m2e connectors". Eclipse list automatically what needed. All you have to do is to click the Finish button.

为了解决这个问题,我点击快速修复选项:“发现新的m2e连接器”。 Eclipse自动列出所需的内容。您所要做的就是单击“完成”按钮。

My Eclipse version is Oxygen.2(4.7.2). Hope this helps.

我的Eclipse版本是Oxygen.2(4.7.2)。希望这可以帮助。

#1


25  

This is an issue with Groovy maven configuration. More specifically, m2e connector issues which are, generally speaking, a nightmare. This link contains good info about the m2e connector mess.

这是Groovy maven配置的问题。更具体地说,m2e连接器问题,一般来说,这是一场噩梦。此链接包含有关m2e连接器混乱的良好信息。

Summary

To fix this, you can grab the m2e connector that springsource provides.

要解决此问题,您可以获取springource提供的m2e连接器。

http://dist.springsource.org/release/GRECLIPSE/e4.2/

http://dist.springsource.org/release/GRECLIPSE/e4.2/

Details

To use it:

要使用它:

  1. Click Help > Install new software...
  2. 单击帮助>安装新软件...
  3. Paste the URL above in the "Work With:" field
  4. 将上面的URL粘贴到“处理方式:”字段中
  5. Expand "m2e Configurator for Groovy-Eclipse"
  6. 展开“用于Groovy-Eclipse的m2e配置器”
  7. Choose the first option "Groovy-Eclipse m2e Integration" and install it
  8. 选择第一个选项“Groovy-Eclipse m2e Integration”并安装它

生命周期配置maven错误未涵盖插件执行

I would also recommend installing the "Groovy/Grails Tool Suite for Eclipse" (GGTS) from the Eclipse Marketplace. I just did both of these (installing GGTS then the connector) in Eclipse Kepler and it solved the exact issue you had, above. This fix also works in Juno.

我还建议从Eclipse Marketplace安装“Groovy / Grails Tool Suite for Eclipse”(GGTS)。我刚刚在Eclipse Kepler中完成了这两个(在插件中安装GGTS),它解决了上面的确切问题。此修复程序也适用于Juno。

#2


0  

In Maven there are few things need to check before this error.

在Maven中,在此错误之前需要检查的事情很少。

  1. Are you able to download the jars from .m2 Repository? -> For this Just delete the repository folder under .m2 Folder and try to update the Maven projects. Then you can see the new Repository folder under .m2 folder. -> Check all the maven-plugin jars are came under org/apache/maven

    你能从.m2存储库下载罐子吗? - >为此只需删除.m2文件夹下的存储库文件夹并尝试更新Maven项目。然后,您可以在.m2文件夹下看到新的Repository文件夹。 - >检查所有的maven-plugin jar都在org / apache / maven下

  2. Check are you able to open the Repository url what ever you mentioned in Settings.xml file -> Open ths url in any browser and check whether are you able to open or not.

    检查是否能够在Settings.xml文件中打开存储库url - >在任何浏览器中打开网址并检查是否能够打开。

  3. Some times thrid party repository jars might be corrupted. -> This will take care by thrid party persons -> Ex: if you are pointing to Nexus repository, they have to upload the required maven jars once again. Some times while uploading the jars might be corrupt.

    有时候第三方存储库jar可能已损坏。 - >这将由第三方人员照顾 - >例如:如果你指向Nexus存储库,他们必须再次上传所需的maven jar。有时上传罐子可能会损坏。

#3


0  

What worked for me was to install the M2E Groovy-Eclipse integration but also to add more configuration to the maven compiler plugin in order to work with java and groovy classes:

对我有用的是安装M2E Groovy-Eclipse集成,但也为maven编译器插件添加更多配置,以便使用java和groovy类:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
       <compilerId>groovy-eclipse-compiler</compilerId>
       <source>1.7</source>
           <target>1.7</target>
    </configuration>
    <dependencies>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-compiler</artifactId>
                    <version>2.8.0-01</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-batch</artifactId>
                    <version>2.1.8-01</version>
                </dependency>
    </dependencies>
</plugin>

#4


0  

I had a similar problem. Eclipse said

我有类似的问题。 Eclipse说

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle (execution: default, phase: validate)

生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle(执行:默认,阶段:验证)

After removed checkstyle, there have been other similar problems.

删除checkstyle后,还有其他类似的问题。

To solve it, I click the quick fixes option: "Discover new m2e connectors". Eclipse list automatically what needed. All you have to do is to click the Finish button.

为了解决这个问题,我点击快速修复选项:“发现新的m2e连接器”。 Eclipse自动列出所需的内容。您所要做的就是单击“完成”按钮。

My Eclipse version is Oxygen.2(4.7.2). Hope this helps.

我的Eclipse版本是Oxygen.2(4.7.2)。希望这可以帮助。