If a project is in process, but a maven lib is needed, for example:
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
Method 1:
In project, File - Project Structure - Libraries - + - From Maven, input com.squareup.okhttp3(That is "groupId"), click Search icon then Arrow icon.
OR
File - New - Module - Maven - Next.
This site can be referred to.
Method 2:
In IntelliJ project panel, choose '${project name}' - right click - Add framework support - Choose 'Maven' - OK.
After this operation, a pom.xml is automatically generated by IntelliJ IDE.