【问题标题】:Build Error whilst running Maven enforcer rule运行 Maven 强制执行规则时生成错误
【发布时间】:2015-11-22 22:29:51
【问题描述】:

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

...
</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>

但在运行目标mvn enforcer:enforce时出现此错误

[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

有人可以帮忙吗???

【问题讨论】:

标签: maven-3 java-7 maven-enforcer-plugin


【解决方案1】:

maven-enforcer-plugin:1.4.1maven:3.0.5 一起使用时,我遇到了同样的错误。将执行器版本降级到1.3.1 就可以了。如果您使用的是更旧版本的 maven,则可能需要降级到较低版本(如 1.0.1)。

【讨论】:

    猜你喜欢
    • 2010-12-22
    • 1970-01-01
    • 2011-12-26
    • 1970-01-01
    • 2014-02-02
    • 2021-12-22
    • 2019-10-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多