“Plugin execution not covered by lifecycle configuration: xxx"问题的解决

问题提出:
在使用Maven过程中,碰到了如下问题:

Plugin execution not covered by lifecycle configuration: io.spring.javaformat:spring-javaformat-maven-plugin:0.0.4:validate
 (execution: default, phase: validate)  

错误信息截图如下:
这里写图片描述
项目中使用的pom.xml的片段如下:

<build>
   <plugins>
      ......
      <plugin>
                <groupId>io.spring.javaformat</groupId>
                <artifactId>spring-javaformat-maven-plugin</artifactId>
                <version>${spring-javaformat.version}</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <inherited>true</inherited>
                        <configuration>
                            <skip>${disable.checks}</skip>
                        </configuration>
                        <goals>
                            <goal>validate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
   .....
  </build>

问题的解决:
经过一番网络上的查找之后,问题的定位为缺失造成的。 可以按照如下来修改:

 <build>
    <pluginManagement>
        <plugins>
            <plugin> ... </plugin>
            <plugin> ... </plugin>
                  ....
        </plugins>
    </pluginManagement>
</build>

然后重新clean项目,编译之后,问题随即消失。

Reference
1. https://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin

猜你喜欢

转载自blog.csdn.net/blueheart20/article/details/80817128