IntelliJ IDEA Tips


Generate annotations

  • Idea automatically generates method comments (including parameters and return values)

Walker’s settings in the community edition of IntelliJ idea 2019.2 are as follows
Template text

 * $VAR1$
$params$ * @return $returns$
 * @author: walker
 * @time: $date$ $time$
 * @description: 

Groovy script

    def result='';  
    def params=\"${_1}\".replaceAll('[\\[|\\]|\\s]', '').split(',').toList();   
    for(i = 0; i < params.size(); i++) {       
        if(i!=0)result+= ' * ';        
        result+='@param ' + params[i] + ((i < (params.size() - 1)) ? '\n' : '');   
    return result", methodParameters())

Maven add local jar package

Add to local warehouse

Take adding 4mc 2.1.0 as an example
Enter bin directory, Walker’s path is

C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.2\plugins\maven\lib\maven3\bin

Enter CMD to execute command

#Multiple lines for easy viewing
mvn install:install-file 

Pom.xml add dependency


This article is from Walker snapshot