如何让 Java maven 构建因编译器警告而失败? [英] How do I get a Java maven build to fail for compiler warnings?

查看:28
本文介绍了如何让 Java maven 构建因编译器警告而失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <compilerArgument>-Werror</compilerArgument>
                <fork>true</fork>
            </configuration>
        </plugin>

但没有快乐.现在有任何想法可以解决这篇博文中建议的此类错误?

but with no joy. Any ideas now to get medieval on such errors as suggested at this blog post?

推荐答案

此答案已过时,但我无法删除它,因为当时它已被接受.

This answer is outdated however I can't delete it as it was an accepted answer at the time.

这是 Maven 的错误,请参阅:https://issues.apache.org/jira/browse/MCOMPILER-120 它已在 Maven-compiler-plugin 的 2.4 中修复,但我认为尚未发布.不幸的是,标签也不起作用.

This a bug with Maven see: https://issues.apache.org/jira/browse/MCOMPILER-120 it's been fixed in 2.4 of the Maven-compiler-plugin but I don't believe that's been released yet. tag won't work either unfortunately.

这篇关于如何让 Java maven 构建因编译器警告而失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆