问题描述
我的公司正在从Eclipse切换到IntelliJ。在Eclipse中,我们在 checkstyle.xml中有一个抑制过滤器的以下配置
My company is switching from Eclipse to IntelliJ. In Eclipse we had a following configuration for suppression filters in checkstyle.xml
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.config.dir}/suppressions.xml"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${common.checkstyle.config.dir}/global-suppressions.xml"/>
</module>
其中:
-
common.checkstyle.config.dir
是公共项目(IntelliJ中的模块)的绝对路径。
common.checkstyle.config.dir
was an absolute path to the common project(module in IntelliJ).
checkstyle.config.dir
是项目(模块)的相对路径,其值为 checkstyle。 config.dir = $ {root.dir} / config / checkstyle
checkstyle.config.dir
was an relative path to the project(module), and has a value of checkstyle.config.dir=${root.dir}/config/checkstyle
我们会想在IntelliJ中定义此文件的路径,因此它会在每个 MODULE / config / checkstyle 目录中查找抑制过滤器(每个模块都有不同的抑制)。
We would like to define a path for this file in IntelliJ, so it would look for the suppression filter in each MODULE/config/checkstyle directory(each module has a different suppression).
有人知道是否有可能吗?我们试图找到一个解决方案很长一段时间,但到目前为止没有运气。
Does anyone know if it is possible? We have tried to find a solution for quite some time, but no luck so far.
推荐答案
感谢Thomas Jensen的回答,我解决了我同样的问题。我在这个问题中详细解答了。希望它有所帮助。
Thanks to Thomas Jensen's answer, I solved my very same problem. I answered in detail in this question. Hope it helps.
这篇关于Intellij checkstyle - 相对于模块的设置路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!