如何在执行Maven期间禁用特定警告? [英] How to disable specific warning during Maven execution?

查看:70
本文介绍了如何在执行Maven期间禁用特定警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我使用的配置,我得到了很多这样的信息:

Due to the configuration I'm using, I get lots of these:

[WARNING] 'dependencies.dependency.systemPath' for local-deps:[...] should not point at files within the project directory, ${basedir}/[...] will be unresolvable by dependent projects [...]

由于这是当前设置应用程序的方式,因此我无法修复它们;但是它们会使控制台杂乱无章,因此有办法禁用它们吗? mvn --quiet不能选择,因为它会删除太多消息.

Since this is how the application is currently setup, I can't fix them; but they clutter the console, so is there a way to disable them? mvn --quiet is not an option because it removes too many messages.

推荐答案

请参见 Maven 3.1.x记录文档.您可以通过编辑${M2_HOME}/conf/logging/simplelogger.properties文件来配置日志级别.首先将org.slf4j.simpleLogger.showLogName的值设置为true,您将看到打印不需要的消息的日志名.之后,添加行org.slf4j.simpleLogger.log.a.b.c=error,其中a.b.c是日志名称.

See the Maven 3.1.x logging documentation. You can configure the log level by editing the ${M2_HOME}/conf/logging/simplelogger.properties file. First set the value of org.slf4j.simpleLogger.showLogName to true and you will see the logname that prints your unwanted message. After that add the line org.slf4j.simpleLogger.log.a.b.c=error where a.b.c is the logname.

这篇关于如何在执行Maven期间禁用特定警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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