Spring Tool Suite 配置关联代码检查模板
来源:互联网 发布:java httpclient请求 编辑:程序博客网 时间:2024/05/16 16:12
在一些代码编程规范较为严格的公司,会有公共的代码规范、格式化等的配置模板,需要自己配置到开发工具中,编码后运行检查,如何在Spring Tool Suite(Eclipse)中配置关联这些模板?在此记录一下。
1.代码模板文件
window-->preferences 搜索 code templates,在右侧的窗口点击import,将模板文件导入,导入后点击查看是否生效
2.代码格式化模板
window-->preferences 搜索 formatter,在右侧的窗口点击import,将模板文件导入,导入后active profile会自动显示你导入的格式化模板名称
3. 代码规范checkstyle模板
window-->preferences 搜索 checkstyle,右侧窗口点击new按钮,type选择external,然后选择具体模板文件,导入文件后,选中文件,点击 set as default。
FAQ:配置好后,运行checkstyle,报错,搜索了网上,说checkstyle新版本中有一些属性去掉了,解决办法,将报错的内容在你导入的check模板文件中去掉
安利一下,经常碰到eclipse报错,详细信息让你看日志,在workspace中.metadata文件夹下的.log文件中可以查看到
报错信息
!MESSAGE Checkstyle-Plugin: cannot initialize module TreeWalker - Unable to instantiate 'RedundantThrows' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.RedundantThrows,
解决
模板文件中将报错的部分去掉
<!-- <module name="RedundantThrows"/> -->
- Spring Tool Suite 配置关联代码检查模板
- Eclipse / Spring Tool Suite 配置
- Spring Tool Suite中配置maven
- Spring Tool Suite插件
- Spring Tool Suite
- Spring tool suite安装
- Spring Tool Suite下载
- STS(spring tool suite)中 Alt + / 代码提示功能失效
- Spring Tool Suite 不自动编译代码 问题解决!
- Spring tool suite初次安装的一些配置
- Spring tool suite初次安装的一些配置
- Spring Tool Suite MVC示例
- spring tool suite在线安装
- Eclipse安装Spring-tool-suite
- Spring Tool Suite 创建spring boot项目
- Spring环境配置(安装springsource-tool-suite插件)及第一个Spring HelloWorld
- Spring tool Suite 安装配置+maven安装配置,搭建maven项目
- Spring tool Suite 安装配置+maven安装配置,搭建maven项目
- python面经总结之常见的问题与基本模块的常见使用方法
- 轮播图封装使用
- ORACLE NO_DATA_FOUND的三种处理办法
- Lintcode 字符大小写排顺序
- PowerDesigner中导出表结构Excel(转载)
- Spring Tool Suite 配置关联代码检查模板
- js对select动态添加和删除OPTION
- 自制轮播图
- C# ArcEngine TOCControl上实现右键
- 深入理解JVM(五)——HotSpot垃圾收集器详解
- 常用技术网站
- 对话框类控件
- android studio fastJson解析数据提示java.lang.NoClassDefFoundError
- Excel公式字符串拼接