

Similarly, if you are using Spring, you can double-click spring-boot:run to run the application.

For example, you can double-click the jetty:run goal in the Plugins sub-tree to deploy and run the web application implemented in the project you imported. You can use a similar approach to run any Maven goal. You’ll see how IntelliJ IDEA executes the install build phase (and all the previous phases in the Maven’s default lifecycle) that downloads dependencies and copies the generated artifacts into your local Maven repository, among other things. To do that, expand the project tree in the Maven view to show the corresponding lifecycle phase and then double-click install: This view shows all the available Maven projects and their build phases and build goals. Open the Maven view by clicking the corresponding option on the left side of the IntelliJ IDEA window: You can run common commands such as mvn install or mvn jetty:runwithout having to leave the IDE. IntelliJ IDEA has excellent integration with Maven. If you don’t want to close your currently opened projects, you can select File > Open on the menu instead. NOTE: The welcome window is only shown when you close all projects in IntelliJ IDEA. Select the pom.xml file of the Maven project you want to import and click Open as Project. However, this is out of the scope of this tutorial. NOTE: Import Project gives you more options to tweak the import process. You can do it in the welcome screen by clicking Open: The most common approach is to open the pom.xml file directly. There are several ways to import a Maven project in IntelliJ IDEA. NOTE: You need Node.js installed on your computer to compile the example application. The project should include a directory with a Maven project in it: Make sure you select the Plain Java Servlet option before downloading the project. NOTE: If you prefer, you can generate a ZIP file with the project at or. This tutorial uses a Maven archetype that generates a web application with a preconfigured Jetty Maven Plugin in it: mvn -B archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST -DgroupId=org.test -DartifactId=webapp -Dversion=1.0-SNAPSHOT See Learning Maven Concepts to learn more. Maven is a project management tool that goes beyond dependency management. This is useful, for example, when using the Jetty Maven plugin that allows you to quickly deploy and run a Java web application using this popular server.

This tutorial explains how to import an existing Maven project into IntelliJ IDEA and how to create a running configuration for a Maven goal.

Importing a Maven project in IntelliJ IDEA
