【发布时间】:2016-01-29 21:12:56
【问题描述】:
我想在 sbt (https://github.com/etsy/sbt-checkstyle-plugin) 和 eclipse (http://eclipse-cs.sf.net/) 中使用相同的 checkstyle 配置
这与 SuppressionFilter 不同 我可以定义文件以便它在 eclipse 中工作:
<module name="SuppressionFilter">
<property name="file" value="${samedir}/checkstyleExcludeFiles.xml"/>
</module>
然后sbt抱怨
org.xml.sax.SAXException: Property ${samedir} has not been set
或者让它在 sbt 中工作:
<module name="SuppressionFilter">
<property name="file" value="checkstyleExcludeFiles.xml"/>
</module>
然后eclipse抱怨
cannot initialize module SuppressionFilter - Cannot set property 'file' to 'checkstyleExcludeFiles.xml' in module SuppressionFilter
我为 ant 找到了这个解决方案: How to define suppressions-definitions for checkstyle, that work with both ant and eclipse
但我是 sbt 的新手,不知道如何在 build.sbt 中定义一个变量,这样它就会被 checkstyle 插件拾取。
我能做什么?我想在 Eclipse 中尽可能少地进行配置,因为这必须在每台开发人员机器上完成。
谢谢
【问题讨论】:
-
现在我有两个 checkstyle 配置,一个用于 sbt,一个用于 eclipse。由于 checkstyle 配置很少更改,这还不错。只是坏..
标签: java eclipse sbt checkstyle