ggat
ggat

Reputation: 472

IntelliJ IDEA maven Run/Debug Configuration, maven goal is run but app does not run automatically

I'm very new to IntelliJ. I want to configure maven project with it. What I have done so far to create run/debug config is, from maven projects window by right-click on the Project Name > Lifecycle > verify and then Create 'Project name [verify]'. So this created the configuration and it actually runs maven verify goal but does not run the app after that.

So output looks something like this:

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.696 s
[INFO] Finished at: 2017-06-21T15:39:20+04:00
[INFO] Final Memory: 10M/150M
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0

As you can see everything goes well. After that I can of course run program manually, but how the hell do I run it automatically?

It seems like runner configuration problem, but dunno.

Upvotes: 2

Views: 3375

Answers (1)

Eelco
Eelco

Reputation: 26

You can create a run/debug configuration (type: Application) for your main class, and add your Maven goal in the 'Before launch' options of the configuration. That will first run Maven and subsequently start your program.

Upvotes: 1

Related Questions