How to build/run only the current Maven module

Answered

Hi,

I have a project with 50 Maven modules and I want to do a Maven Run Configuration that is just running the module that I'm currently working in (so it should be derived from the context). I tried to put $MODULE_DIR$ into the working directory field, but this does not work. I don't want to make one Run Configuration for each module because this means I would have to maintain and switch between 50 Run Configurations.

Is there a solution that helps me with my problem?

Also, when I switch branches, it sometimes takes very long until the IDE gives support on the module I'm currently working on (shows problems, offers help to add import etc.). Is it somehow possible to tell the IDE to build the module I'm currently working on first?

Thanks for your help!

0
1 comment

>I want to do a Maven Run Configuration that is just running the module that I'm currently working in (so it should be derived from the context).

We have in plans the improvement which would allow to run Maven goal by default for the Maven module you are currently working on (e.g. for the module that has been selected in project tool window or Editor has the file from that module opened), please vote and follow this request: https://youtrack.jetbrains.com/issue/IDEA-227721

>Also, when I switch branches, it sometimes takes very long until the IDE gives support on the module I'm currently working on (shows problems, offers help to add import etc.). Is it somehow possible to tell the IDE to build the module I'm currently working on first?

On branch switch the source files and pom.xml files are changed and IDE needs to re-import all changed Maven projects in order to set up the proper project structure and dependencies for the changed in modules configuration.

At the moment there is no such ability to influence the order of the modules for the import. Note that there could me intermodule dependencies. Also it is not possible to index project partially (i.e. index one module but not other) when some of the modules has been re-imported but some has been not.

If you have in projects modules you are not working on you can ignore such modules.

0

Please sign in to leave a comment.