Alibaba Java Code Guidelines
Alibaba launched a statute of Java code scanning plug-in, according to "Ali Baba Java Development Manual" provisions of the code style and quality of real-time detection, constraints. Strong push.
eclips
AndIDEA
has a corresponding plug-ins. Installation and use tutorial, see the official documentation.
Tutorial: https://github.com/alibaba/p3c/wiki/IDEA%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8%E6%96%87%E6 % A1% A3GsonFormate
JSON
Plug quickly generate entity classes, specific use and configure keyboard shortcuts to find Google.lombok
We java development process, there are often routine, repetitive work. such as:It generates get and set methods according to member variables
The constructor of the class member variables generated
Override toString () and hashCode method
Introducing logging framework logFactory, for printing log
These are some repetitive movements, template code. Every time manually generate a waste of time, but also adds a lot of redundant code. We can use lombok plugin to solve this problem. So that our coding efficiency has been greatly improved!
We need to use the
pom
introduction of dependent files<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency>
Example:
@Data // 等于getter/setter方法 @NoArgsConstructor //无参构造 @AllArgsConstructor // 全参构造 @Slf4j // 等于logger public class Article { private Long id; private String author; private String title; private String content; private Date createTime; private List<Reader> reader; @Override public String toString() { return "Article{" + "id=" + id + ", author='" + author + '\'' + ", title='" + title + '\'' + ", content='" + content + '\'' + ", createTime=" + createTime + ", reader=" + reader + '}'; } }
Although the editors have shortcuts can be generated, but this is not it more simple and efficient!
devtools
Hot deploymentIn
springboot
project development, particularly easy to use.The introduction of dependence
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
Add Configuration
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
Set IDEA
Double-clickshift
> SearchRegistry
> select the tickcompiler.automake.allow.when.app.running
.
File
>Settings
>Build,Execution,Deplyment
>Compiler
, Select the tickBuild project automatically
.Enjoy it!
Maven Helper
In the
pom.xml
middle you can see all the dependencies, easy to troubleshoot problems.
Continually updated. . . . . .
Above a few really lazy shots are direct plug-in download store, restart the editor on it.
有问题的可以留言,有更好的也可以推荐一下,多谢大家!