我正在使用 Maven,带有 one-jar 插件,但是当我运行 one-jar 可执行文件时,我遇到了一堵警告墙,这是不可接受的使用
我查看了一个罐子上的所有可用资源,但没有看到有关如何保持罐子在运行时发出大量警告的说明,有人解决了这个问题吗?
JarClassLoader: Warning: META-INF/LICENSE.txt in lib/commons-io-1.4.jar is hidden by lib/commons-collections-3.2.1.jar (with different bytecode)
JarClassLoader: Warning: META-INF/NOTICE.txt in lib/commons-io-1.4.jar is hidden by lib/commons-collections-3.2.1.jar (with different bytecode)
JarClassLoader: Warning: META-INF/LICENSE.txt in lib/commons-lang-2.4.jar is hidden by lib/commons-collections-3.2.1.jar (with different bytecode)
JarClassLoader: Warning: META-INF/NOTICE.txt in lib/commons-lang-2.4.jar is hidden by lib/commons-collections-3.2.1.jar (with different bytecode)
我发现如果你创建一个one-jar.properties
文件并将其放在运行时类路径的根目录中(即项目 .class 文件结束的位置),它将被 one-jar Boot 类读取。该属性文件中的条目例如:
one-jar.silent=true
将完全抑制 one-jar 日志消息。
Boot 类寻找的其他值是one-jar.info
and one-jar.verbose
.
默认级别为 INFO。正如 Pascal Thivent 上面指出的,您还可以通过命令行设置系统属性-D
的参数java
命令,但如果您不想必须规定或记住这一点,则属性文件方法非常有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)