Creating a new Maven project in IntelliJ IDEA

IntelliJ IDEA is an IDE from JetBrains. It has both Community and commercial editions. IntelliJ IDEA is enormously popular among developers and is regularly updated with the latest language and platform features.

For the purpose of this cookbook, we will use the Community Edition. The steps are the same for the commercial edition as well.

As of writing this book, IntelliJ IDEA 14.0.3 is the most recent edition. The screenshots in this book reflect this version.

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...

Use the following steps to create a new Maven project in IntelliJ IDEA:

  1. Open IntelliJ IDEA.
  2. Click on Create New Project.
  3. Choose Maven.
  4. Select the Create from archetype option and choose maven-archetype-quickstart:1.1:
    How to do it...
  5. Specify the values required to create the project:
    How to do it...
  6. Confirm the values for the project:
    How to do it...

You are done! A new Maven project is created in IntelliJ IDEA.

How it works...

IntelliJ IDEA has first-class support for Maven. It can create a new Maven project as per archetype by downloading the required plugins and dependencies from the repository. It uses the configured Maven settings, which can be customized as specified in the next section.

There's more...

You can customize Maven in IntelliJ IDEA by opening the Maven settings as follows:

  1. Navigate to Configure | Settings:
    There's more...
  2. Click on Maven on the left panel:
    There's more...
  3. Click on Override to change the values as you desire.
  4. Change a few of the default options such as Work offline or Output level:, as shown in the preceding screenshot.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.62