Importing an existing Maven project in IntelliJ IDEA

While we can use IntelliJ IDEA to create a new project, in most cases you will already have an existing project in your filesystem. In the latter scenario, you will want to import this project.

Getting ready

As IntelliJ IDEA needs a Java environment to run, let us first ensure that the Java environment is set up on our system:

  1. Ensure that JDK is installed.
  2. Download IntelliJ IDEA by visiting https://www.jetbrains.com/idea/ and clicking on the Download link.
  3. Ensure the project SDK is set to your Java installation.

How to do it...

To import an existing Maven project in IntelliJ IDEA, perform the following steps:

  1. Start IntelliJ IDEA.
  2. Choose Import Project. Browse for the simple project that we created earlier: ...

Get Apache Maven Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.