在一些代码编程规范较为严格的公司,会有公共的代码规范、格式化等的配置模板,需要自己配置到开发工具中,编码后运行检查,如何在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安装配置tomcat服务器功能,同时也适合eclipse开发工具.
支持SpringToolSuite4的插件,共三个,下载解压后,把三个文件夹里边的features和plugins拷贝到sts安装目录下即可,已测试可用,org.tmatesoft.svn_1.10.1.eclipse、subclipse-4.3.0、Subversive-connectors-4.1.3.I...
SpringToolSuite4 工具 快速开发,友好提示,对于idea工具相当于eplise界面,基于eplise,相对而言来说,代码更加友好提示,快速集成高效开发。
使用STS(SpringToolSuite)工具Spring Boot整合MyBatis详细代码
Spring Tool Suite工具的安装
Java 热部署操作笔记。Spring Tool Suite.网上能看到的资源多事mvn 的,再这个文档里面,很详细的介绍了.yml元素的写法。和注意事项。
eclipse,myeclipse,spring tool suite安装svn1.8插件,内附svn插件,需要执行的java文件!以及安装文档
spring boot 支持工具spring tool suite 3.9.5 对应eclipse版本4.8
spring source tool suite开发环境+virgoTomcatServer(part1)
Windows安装Spring Tool Suite 4开发工具的安装文件
spring tool suite是一个eclipse插件,利用该插件可以在eclipse中更方便地开发spring代码。
该文件为基于 Eclipse 的一款 IDE,为 Spring 开发定制的,方便创建、运行、维护、调试 Spring 项目。
spring-tool-tuite插件。这个是用于eclipse快速开发的使用,(文件内下载链接)
Spring Tool Suite针对4.8.0的升级包,可以通过离线安装的方式安装,如果在线安装出错,或者不能连接网络时用,注意安装时把所有在线更新的源前面的勾取消会加快速度。
从Spring官网下载的最新版本的IDE工具,基于eclipse进行的二次开发,对spring的开发更便捷。由于上传包大小的限制,共分为9个压缩包。版本号为3.7.1.RELEASE 支持windows 64位操作系统
spring-tool-suite
spring-tool-suite-3.9.9.RELEASE-e4.11.0-win32-x86_64.zip
免安装,直接解压使用
spring-tool-suite-3.8.1.RELEASE-e4.6-win32-x86_64.7z.008