Auto / Short cut for executing maven goal

Answered

I am on IntelliJ 15. My projects contain a lot sub-projects each with their own pom.xml. I usually need to do a "mvn clean install" inside a project if I only want to create the .jar for these one and not for all. 

Is there a way to tell IntelliJ to automatically execute "mvn install" or other maven goals? The best would be to couple that with every change occuring to a .java file. 

 

Auto compile / make is not what I need because I need the .jars.

5 comments
Comment actions Permalink
Official comment

You can create an External Tool that will run mvn in the specific folder. It's also possible to assign a keyboard shortcut to the external tool. If you want it to trigger on file change, use File Watchers plug-in. Assigning keyboard shortcuts to run/debug configurations is not implemented yet.

However, you can assign keyboard shortcuts to Maven goals and also execute them upon certain events (after Make, after Rebuild, etc):

Comment actions Permalink

Is there a way to set a shortcut for several Maven goals?

Like "clean install someplugin:exec".

I have around 200 modules and I can assign shortcut only for one project at a time.

Is there a way to assign a shortcut, that will work for a project, that opened in an editor.

0
Comment actions Permalink

Hello,

You could create External Tool as suggested earlier for multiple goals and use macro for working directory. This tool will be available in all projects and macro will be resolved to current project.

Also feel  free to create feature request on YouTrack: http://youtrack.jetbrains.com/issues/IDEA.

0
Comment actions Permalink

Thank you!

All this time I've searched for a solution.

And it's was that simple!

0
Comment actions Permalink

You are welcome!

0

Please sign in to leave a comment.