How to run Java project with Maven?

Answered

Greatings,

I'm trying to use IntelliJ (latest version) with Java and Maven. Without Maven I would define Run/Debug configuration and use it to run and debug my Java SE application. It works perfectly. With Maven and multi-modules I can clean, install, package etc my application. I can run the tests. But how should I just run or debug my application from IntelliJ? At the moment I can only do this from the terminal window with "java --module-path .. --module ...". What should I specify in the Run/Debug Configuration or Maven Plugin/Lifecycle to run/debug the application from IntelliJ?

Thanks in advance

Andrej

0
2 comments

Hi Andrej,

You can create a plain Application run configuration and configure it according to your needs.

After that, the configuration will be available in the corresponding drop-down on the Navigation bar so that you can run/debug your app quickly.

 

You can also use a Maven run configuration. In this case, goals and other options need to be specified in the Command Line field. Alternatively, you can create a run configuration out of a specific goal.

Related help articles:

1

Hi Arina,

Thanks a lot for your help! I got it running now.

Regards,

Andrej

0

Please sign in to leave a comment.