ยงImporting an existing Maven project into IntelliJ
If you worked through the command line example for Maven, you have a Maven project that you can integrate into Intellij IDEA Using built in IntelliJ Maven support. Before integrating your project, make sure that your IntelliJ Settings use the following:
- Maven 3.3 or higher
- A JDK 1.8
Note When developing with Lagom you will often run several services in a single Java Virtual Machine. See how to increase Memory for Maven.
To integrate an existing Maven Java project into IDEA, follow these steps:
-
Open IntelliJ IDEA and close any existing project.
-
From the
Welcome
screen, click Import Project.
TheSelect File or Directory to Import
dialog opens. -
Navigate to your Maven project and select the top-level folder. For example, with a project named
my-first-system
: -
For the Import project from external model value, select Maven and click Next.
-
Select Import Maven projects automatically and leave the other fields with default values.
-
Click Next.
Your Maven project should be selected for import: -
Click Next.
The Please select project SDK screen opens. -
Make sure the correct JDC is selected and click Next.
-
Change the project name and location if you like, and click Finish.
-
Create a run configuration to test your project:
-
Build your project and run it using the configuration you created.
The console displays the following when Lagom is running: -
Verify that the services are indeed up and running by invoking the
hello
service endpoint from any HTTP client, such as a browser:http://localhost:9000/api/hello/World
The request returns the message
Hello, World!
.