gpt4 book ai didi

java - 生命周期配置未涵盖插件执行?

转载 作者:行者123 更新时间:2023-12-01 12:08:24 24 4
gpt4 key购买 nike

我的 pom.xml 文件中有以下配置

 <plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jslint</goal>
<goal>compress</goal>
</goals>
</execution>
</executions>
.............
</plugin>

我在 eclipse kepler 中看到以下错误

Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration:
net.alchim31.maven:yuicompressor-maven-plugin:1.3.0:compress (execution: default, phase:
compile)
- Plugin execution not covered by lifecycle configuration:
net.alchim31.maven:yuicompressor-maven-plugin:1.3.0:jslint (execution: default, phase:
compile)

我不确定是什么原因造成的?

最佳答案

你必须在maven的生命周期映射中添加这些jslint和compress。默认情况下它不被maven生命周期覆盖。在 pom 中,您可能有快速链接来添加生命周期映射,否则您必须在 pom.xml 文件中手动添加它。

     <pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jslint</goal>
<goal>compress</goal>
</goals>
</execution>
</executions>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</lifecycleMappingMetadata>
< /configuration>
</plugin>
</plugins>
</pluginManagement>

此代码将帮助 Maven 将插件包含到生命周期映射。希望有帮助!!

关于java - 生命周期配置未涵盖插件执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27407414/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com