我在将 checkstyle 添加到我的构建文件时遇到问题。我一直在尝试遵循http://checkstyle.sourceforge.net/anttask.html上的教程,并查看使用 checkstyles 的代码示例并找到我的问题的解决方案(例如No output from Checkstyle in ANT),但是当我构建文件时(终端命令 ant compile jar run),checkstyle 似乎没有发生任何事情。我想我已经在正确的目录中插入了包。这是我的构建文件代码的一部分:
<property name="checkstyle.dir" location="home/lakers/NoteTaker/analysis/bin/checkstyle-5.6" />
...
<target name="checkstyle">
<taskdef resource="checkstyletask.properties">
<classpath>
<pathelement location="home/lakers/NoteTaker/analysis/bin"/>
<pathelement location ="home/lakers/NoteTaker/analysis/bin/checkstyle-5.6/checkstyle-5.6-all.jar"/>
</classpath>
</taskdef>
<echo>Starting checkstyle</echo>
<checkstyle config="sun_checks.xml" failOnViolation="false">
<fileset dir="src" includes="**/*.java"/>
<fileset dir="NoteTaker/NoteTaker/src/notetaker" includes="**/*.java"/>
<formatter type="plain"/>
</checkstyle>
<echo>Checkstyle finished</echo>
</target>
如果我说的有什么不清楚的地方,请告诉我,我会尽力澄清。非常感谢您的帮助。:)