Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running mvn command using IntelliJ IDEA

Tags:

I want to run a command

mvn clean dbmaintain:updateDatabase 
  1. How can I run this command for a project opened in IntelliJ IDEA 12?

  2. If I will run this command, will it automatically run the scripts commands on my db server that's mentioned in my pom.xml file or jdbc.properties file?

like image 961
coure2011 Avatar asked Mar 19 '13 05:03

coure2011


People also ask

How do I run commands in IntelliJ?

Run commandsStart typing the command name and navigate the suggestion list using the arrow keys. When you press Space , you accept the current suggestion and get further suggestions specific to this command. To get the list of available commands, type ? . The list of commands depends on the installed/enabled plugins.

How create Maven run in IntelliJ?

Create a run/debug Maven configuration From the main menu, select Add Configuration. Alternatively, right-click any task in the Maven tool window and select Modify Run Configuration.


1 Answers

If your project has been detected by IntelliJ as a Maven project, then you should take a look at the Maven project window, on the right side. Your project should show up as a node, with a Lifecycle subnode. If you expand it, you will see the available goals, including clean.

Right-click on this goal, choose Create yourProject[clean] and in the popup window you will be able to add extra goals to run, including dbmaintain:updateDatabase. Running this configuration will be exactly the same as running the command from an external command prompt.

If your project has not been detected as a Maven project, try reimporting it by opening the root pom.xml using File > Open. IntelliJ will ask if you want to reopen the project using the Maven structure.

like image 101
Bastien Jansen Avatar answered Oct 14 '22 05:10

Bastien Jansen