这是啥 Maven 错误? “生命周期配置未涵盖插件执行...)”

Posted

技术标签:

【中文标题】这是啥 Maven 错误? “生命周期配置未涵盖插件执行...)”【英文标题】:What is this Maven error ? "Plugin execution not covered by lifecycle configuration...)"这是什么 Maven 错误? “生命周期配置未涵盖插件执行...)” 【发布时间】:2017-05-17 14:25:03 【问题描述】:

“生命周期配置未涵盖插件执行:com.soebes.maven.plugins:iterator-maven-plugin: 0.4:iterator (execution: javascript-dependencies_unpack-dependencies, phase: initialize)”

尝试在https://github.com/pentaho 构建 Pentaho 项目。除了 https://github.com/pentaho/maven-parent-poms 的 maven-parent-poms 之外,它们都不会构建。几乎所有其他项目都会在相应的 .pom 文件中引发此错误。有关错误的位置,请参阅下面的屏幕截图。

我确实使用来自 Apache 的当前版本的 Maven 覆盖了 Eclipse Maven 扩展。没有改变任何东西。

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>pentaho</groupId>
    <artifactId>pentaho-platform-ce-parent</artifactId>
    <version>8.0-SNAPSHOT</version>
  </parent>
  <artifactId>pentaho-platform-api</artifactId>
  <version>8.0-SNAPSHOT</version>
  <properties>
    <maven-surefire-plugin.reuseForks>false</maven-surefire-plugin.reuseForks>
    <mockito-all.version>1.8.5</mockito-all.version>
    <license.header.definition.file>$basedir/../license/styles/javadoc_style_license_header.xml</license.header.definition.file>
    <commons-lang.version>2.4</commons-lang.version>
    <license.header.file>$basedir/../license/templates/LGPL-2.1.txt</license.header.file>
  </properties>
  <dependencies>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>$commons-logging.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>$commons-lang.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
      <version>$dom4j.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>$spring.security.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>$spring.framework.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>$slf4j-api.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-connections</artifactId>
      <version>$project.version</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-actionsequence-dom</artifactId>
      <version>$project.version</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-xul-core</artifactId>
      <version>$project.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-database-model</artifactId>
      <version>$project.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>pentaho</groupId>
      <artifactId>pentaho-service-coordinator</artifactId>
      <version>$project.version</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>$junit.version</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>$mockito-all.version</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>*</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>

【问题讨论】:

尝试在你的&lt;plugins&gt;标签周围添加&lt;pluginManagement&gt; 标签,看看是否有效 当你使用命令行mvn package时它会运行吗? @UlugToprak 更改 pom 不是正确的方法。这些项目来自 github,因此,我们应该假设它们是正确的。 【参考方案1】:

问题与Eclipse M2E 有关,您需要告诉 Eclipse 例如它应该忽略插件等。

<pluginManagement>
  <plugins>
    <plugin>
     <groupId>org.eclipse.m2e</groupId>
     <artifactId>lifecycle-mapping</artifactId>
     <version>1.0.0</version>
     <configuration>
       <lifecycleMappingMetadata>
         <pluginExecutions>
           <pluginExecution>
             <pluginExecutionFilter>
               <groupId>some-group-id</groupId>
               <artifactId>some-artifact-id</artifactId>
               <versionRange>[1.0.0,)</versionRange>
               <goals>
                 <goal>some-goal</goal>
               </goals>
             </pluginExecutionFilter>
             <action>
               <ignore/>
             </action>
           </pluginExecution>
         </pluginExecutions>
       </lifecycleMappingMetadata>
     </configuration>
    </plugin>
  </plugins>
</pluginManagement>

这是执行此操作的旧方法。还有更新的方式since 1.7 of m2e:

您可以将忽略等直接包含在执行的配置中:

<?m2e ignore?> 
<?m2e execute?>
<?m2e execute onConfiguration?> 
<?m2e execute onIncremental?> 
<?m2e execute onConfiguration,onIncremental?> 
<?m2e configurator configuratorId?> 

例如:

  <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.0.0</version>
        <configuration>
          <updatePomFile>true</updatePomFile>
        </configuration>
        <executions>
          <execution>
            <?m2e ignore?>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <?m2e ignore?>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

【讨论】:

这就是整个pom。我把它贴在 OP 上。

以上是关于这是啥 Maven 错误? “生命周期配置未涵盖插件执行...)”的主要内容,如果未能解决你的问题,请参考以下文章

各位大神,小弟启动访问Maven项目时报了如下错误,有知道啥原因额嘛

maven项目啥时候用到编译,打包

idea导入的maven工程,每个实体中类名就会变红 啥原因

dyld:警告:这是啥错误?

这是啥错误? - 在构建阶段失败

有代码,但这是啥错误?