Reference: Convert a regular project into a maven project
- Open the existing project in IntelliJ
- In the
Projecttool window, right-click your project and selectAdd Framework Support. - In the dialog that opens, select
Mavenfrom the options on the left and clickOK. - Open the generated POM and specify a
groupId. The artifactId and version are specified automatically. - Add more depcendencies by updating
pom.xml.
For instance, add Junit5 support:
- Open project level
pom.xml - Press
Alt+Insert. Select In the dialog that opens, enterjunitand selectorg.junit.jupiter:junit-jupiter. - Click
Load Maven Changesin the top right corner.