1
我試圖將checkstyle jar集成到我的java git項目資源庫中以確保編碼標準。我配置的CheckStyle的jar和xml文件(因爲它作爲默認的路徑沒有配置java.command)爲Git:無法訪問git中配置的jar文件
git config --add checkstyle.jar d:/checkstyle-5.6.jar
git config --add checkstyle.checkfile d:/checkstyle_checks.xml
然後從here添加perl腳本作爲pre-commit鉤子。 然後更改了java文件並添加它。嘗試執行更改時,錯誤消息顯示爲Unable to access jarfile d:/checkstyle-5.6.jar commit abort
配置jar和xml文件是否存在任何問題?
看起來你使用的是Windows,是嗎?如果是這樣,'dir d:\ checkstyle-5.6.jar'列出一個實際的文件嗎?也許你需要在你的路徑中使用'\'而不是'/'? – bluefeet
是的。它的工作 – Sajeev