首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行Maven enforcer规则时发生构建错误

运行Maven enforcer规则时发生构建错误
EN

Stack Overflow用户
提问于 2015-08-28 17:44:17
回答 1查看 4.9K关注 0票数 1

我在我的POM中添加了以下内容,以便我可以使用Maven enforcer ruleset -

代码语言:javascript
复制
...
</plugins>
        </pluginManagement>
    </build>
</project>
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>1.4.1</version>
    <executions>
        <execution>
            <id>enforce-no-snapshots</id>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <rules>
                    <requireReleaseDeps>
                        <message>No Snapshots Allowed!</message>
                        <excludes>
                            <exclude>org.apache.maven:maven-core</exclude>
                        </excludes>
                    </requireReleaseDeps>
                </rules>
                <fail>true</fail>
            </configuration>
        </execution>
    </executions>
</plugin>  
...
</plugins>
        </pluginManagement>
    </build>
</project>

但我在运行goal mvn enforcer:enforce时遇到以下错误

代码语言:javascript
复制
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.405s
[INFO] Finished at: Tue Sep 01 14:35:26 IST 2015
[INFO] Final Memory: 11M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project XXX
QAParent: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce are missing or in
valid -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException

谁能帮帮忙?

EN

回答 1

Stack Overflow用户

发布于 2016-08-08 08:08:42

maven:3.0.5中使用maven-enforcer-plugin:1.4.1时,我也遇到了同样的错误。将enforcer版本降级到1.3.1就解决了这个问题。如果您使用的是更旧版本的maven,则可能必须降级到较低的版本(如1.0.1)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32268036

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档