IDEA common tools & configuration

IDEA common tools & configuration

If you find that the plug-in market is not available, you can set Http Proxy, click "Check connection" on this interface and enter the address: https://plugins.jetbrains.com/ .

0

1. Commonly used plug-ins

1、MybatisX

Mybaits Plus plug-in, supports java and xml conversion


2、FindBugs-IDEA

Detect possible bugs and irregular locations in the code, and check to avoid low-level bugs after writing the code.

Plugin address: FindBugs-IDEA - IntelliJ IDEs Plugin | Marketplace

Remarks: The online installation of this plugin may fail, and it is recommended to install it offline.

Success sign: "FindBugs-IDEA" appears in the lower left corner of the plug-in successfully loaded


3、Maven Helper

View maven dependencies with one click, view conflicting dependencies, and exclude dependencies with one click

Success sign: "Dependency Analyzer" appears in the lower left corner of the pom file

1) Conflicts (view conflicts)

2) All Dependencies as List (view all dependencies in list form)

3) All Dependencies as Tree (view all dependencies in tree form)


4、VisualVM Launcher

Start visualvm when running a java program, which is convenient to view the situation of jvm, such as the allocation of heap memory size

How much memory is occupied by an object, a necessary tool for jvm tuning

1) Plugin address: Maven Helper - IntelliJ IDEs Plugin | Marketplace

Success sign: next to the startup method, there are debug and run with an orange background, indicating that the plug-in is installed successfully.

2) To start the vm, you also need to download the client

Link: Baidu Netdisk Please enter the extraction code

Password: bxib

Link: Baidu Netdisk - link does not exist

Extraction code:  6735

3) After successfully downloading the vm client

Unzip the client, it is recommended to extract it to the idea directory.

Open the settings configuration panel

Configure excutable=== "Select the visualvm.exe file in the bin directory of the client

0

Right-click to start using the VM plug-in

0

 

You can view the jvm status, and then you can debug it yourself:

 

 

0


5、Translation

The best translation plug-in with powerful functions and beautiful interface.

Plugin address: https://plugins.jetbrains.com/plugin/8579-translation

Success sign: After restarting the idea, if the plugin is loaded successfully, "Google Translation" will appear in the lower right corner.

How to use: Right click on a word.


6、Alibaba Java Coding Guidelines(P3c)

The java code specification plug-in produced by Alibaba.

Can scan the entire project to find irregularities and most of them can be automatically fixed

Although the detection function is not as powerful as findbugs, it can be automatically repaired

Alibaba Java Coding Guidelines plugin support.

Plugin address: https://plugins.jetbrains.com/plugin/10046-alibaba-java-coding-guidelines

Sign of success: Click the tools in the IDEA menu bar, and Ali coding constraints appear.

How to use: Right-click and click Coding Constraint Specification.


7、lombok

Solve the problem that IDEA cannot recognize lombok.

Plug-in address: https://www.projectlombok.org/download


8、PlantUML integration

mac needs to install homebrew in advance: macOS (or Linux) missing package manager — Homebrew

1) Install Graphviz. After installation, you need to restart IntelliJ IDEA to make Graphviz take effect.

Official: Download | Graphviz , it is recommended to download from Baidu Cloud.

Baidu: Baidu Netdisk - link does not exist

2) IDEA creates a new UML, and then configures Graphviz

 

0


9. EasyCode code generator

1) ctrl+alt+s --> select Plugins --> install Easy Code plug-in --> pay attention to restart idea after installation!

2) After installing the plugin, select Database in IDEA

3) Configure the code generator ctrl+alt+s --> select EasyCode --> Template Setting

4) Generate code: select database table generation


10. Background Image Plus background image settings

 

0


11. Grep Console log highlight

 

0


12. Rainbow Brackets rainbow brackets

When the code is very complex, all kinds of matryoshka-style brackets are heartbreaking. Rainbow Brackets is a plug-in that can color paired brackets. As the name suggests, "rainbow-colored brackets", complex code can be seen through at a glance. !

After installing the plug-in, the brackets are dyed the colors of the rainbow.


13. Statistic code statistics

Statistical code volume:

  • count how many lines of code
  • Statistical actual code volume
  • Count blank lines
  • Statistical Annotations

0

14、RestfulToolkit

  • Quickly locate the url in the controller
  • Quickly test the url in the controller (can replace postman)

15. GsonFormat quickly converts java objects

Create a new Test.java class, right-click to find GsonFormat, click to enter and paste the json code for confirmation.

 

0

0

16. Json Parser formats json files

Json Parser。

17、Properties

.properties key-value pair file, Chinese automatic recognition.

18、GittoolBox

Used with the version control tool git, it is very intuitive to display the current project branch, and the number of codes that have not been updated and submitted. Save unnecessary troubles such as querying branches and latest code.

You can mainly check each line of code and who did the development at that time.

19、EasyYapi

Idea's plug-in - can quickly generate yapi interface documents (code 0 intrusion).

20、 Git Commit Template

git commit specification plugin.

 

0


Other: IDEA export file plugin

21、 any-rule

Regular expression plug-in, right click on the blank space to view it.

22、sonarlint

The plug-in name of sonar is sonarlint

Two, common configuration

1. Custom java class annotations (useful every time a class is created)

  1. File ->Setting ->Editor ->File and Code Templates
  2. Open the tab of includes in the panel -> File Header

/**

* @author rocky([email protected])

* @date ${YEAR}-${MONTH}-${DAY}

*/

2. Customize the method template in eclipse format

  1. File ->Setting ->Editor ->Live Templates

Click the "plus sign" to create a new "Template Group": rockyDefine

  1. Set Enter mode trigger

 

0

Abbreviation:

*

Template text:

*

*

* $param$

* @return $return$

* @author rocky

* @date $date$

*/

Edit vaiables:

date

date()

param

groovyScript("_1.collect {'@param ' + it}.join('\\n * ') + ''", methodParameters())

return

methodReturnType()

Check "Skip if defined" in the above fields

3. Put the mouse on the idea to display the comment

  1. open idea
  2. file--->setting--->Editor--->General has one in other (idea2021 version is in file-setting-Editor-Code Editing)

show quick documentation on mouse move Mark this √

4. The maven console in idea is garbled

setting ->Build Tools ->Maven ->Runner ->VM Options:-Dfile.encoding=GB2312

 

0

5. Errors are reported in maven compile, package, etc. in idea

1) The package com.sun.image.codec.jpeg does not exist or the symbol cannot be found. Please ensure that the jdk version compiled by maven is consistent with the jdk version of the project.

 

 

0

0

0

2)${java.home}/lib/rt.jar;${java.home}/lib/jce.jar

3) The jar packaged by spring-boot-maven-plugin is unreliable, and the new exec adjustment is as follows:

<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <classifier>exec</classifier> </configuration> </plugin>

ps: If the project cannot find the dependent project, you can maven install the dependent project first.

6、IDEA屏蔽mapper:No beans of 'SysLogMapper' type found.

Modify the idea configuration and set the spring severity value to "warning", as follows:

 

0

7. IDEA generates chm

IDEA generates chm documents in the "Tools->Gerenate JavaDoc" panel

Other command line arguments:

-encoding utf-8 -charset utf-8

8. IDEA comes with http simulation

After the top toolbar is opened in turn Tools -> HTTP Client -> Test RESTFUL Web Service, the interface of the IDEA REST Client console is as follows

9. Shield too many yellow warnings setting->Inspections->

1. Ignore the parameters and comments of java class methods;

Javadoc issues->

Masking of inconsistent parameters: Declaration has problems in Javadoc referen red color is changed to waring

There is no comment on the parameter: Dangling Javadoc comment, Declaration has problems remove the check

2. Ignore neverused

Java->Unused declaration remove the check

3、Could not autowire. No beans of … type found

The value of Spring->severity is set to "warning"

3. Frequently asked questions

1. The spring-boot-starter-web package became popular, and the download of org.openjfx:javafx.base jar failed

In the latest version of IDEA, maven uses the jre11 version by default, and needs to be adjusted to the jre version consistent with the project (for example: jre1.8).

ps: Find the maven->import interface in the setting method setting.

4. Others

  1. View code history version
  2. Adjust the virtual memory of idea:
  3. idea is set as the shortcut key of eclipse
  4. Set prompt words to ignore case
  5. Turn off code inspection
  6. Set up documentation comment templates
  7. show method separator
  8. set multi-line tab
  9. Curly bracket position of quick match method
  10. end of code completion
  11. fuzzy search method
  12. Preview the code of a class
  13. See where the method is called
  14. Code templates (code shortcuts)
  15. Automatic package import, automatic removal of useless packages
  16. Codota plugin: It can give priority to the classes and methods with high frequency of use
  17. Quickly view comments on classes and fields
  18. Bracket color distinction
  19. Add different projects to the same startup window in the microservice project
  20. idea global settings (settings that open a new window)
  21. The java mapper layer code file and the mapper.xml file jump to each other
  22. Set the idea background image
  23. maven tree (view maven jar package dependencies)
  24. Shortcut key to switch back to the tab that was opened on the previous click
  25. The ssh connection tool that comes with idea
  26. Code call link graph plugin
  27. Get the current thread dump
  28. Idea has multiple ports open for the same project

Guess you like

Origin blog.csdn.net/kanhcj86/article/details/132314154