Importing an existing Maven project in NetBeans
Instead of creating a new Maven project, as we did in the preceding recipe, you may want to open an existing Maven project in NetBeans. Let us now see how we can import an existing Maven project.
Getting ready
NetBeans can be downloaded in two different ways (if not downloaded already):
- Oracle provides a download of the latest JDK along with the latest version of NetBeans. This is a good option, especially if you haven't installed JDK yet.
- If JDK is already installed, then NetBeans can be downloaded separately at https://netbeans.org/. There are different bundles of NetBeans (similar to Eclipse). You can choose one from Java SE or Java EE, or all of them, based on your preference.
How to do it...
To import an existing Maven project in NetBeans, perform the following steps:
- Navigate to File | Open Project...:
- Choose the project we created earlier from the command-line. Notice how NetBeans recognizes it (with the ma icon) as a Maven project:
- NetBeans...