Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure intellij to run all maven plugins specified in the pom file

I have been surprised to see that some of the plugins specified in my pom file are not run by intellij. These two questions have been helpful to gain a little more understanding: IntelliJ IDEA: Maven, project compilation and deployment and Using IntelliJ IDEA with Maven projects that use the "generate-sources" or "process-classes" lifecycle phases

From what I gather, intellij doesn't run any plugins that are bound to the non-basic lifecycle phases (basic meaning those shown when the "Show Basic Phases Only" option is active in the Maven Projects window).

I understand that intellij takes over the build process so that the default maven lifecycle isn't run in its true sense so extra configuration is needed. The answers I've seen (which have been few) have suggested marking these lifecycles to execute when a make or rebuild is done (e.g. right click on the project's maven lifecycle in the maven projects window and set it to "execute before make", etc.).

This is annoying because it will go through all the phases, up through process-classes, then in the make it will rerun compilation. This effectively removes any type of incremental build. Please correct me if this is wrong.

Is there anything comparable to eclipse m2e's lifecycle mapping that can configure what to do in these cases?

If not, is there a way to configure intellij to run these plugins that:

  1. wont kill incremental building
  2. is shareable configuration with coworkers, since we'd all want the same config
like image 731
Noremac Avatar asked Oct 21 '22 02:10

Noremac


1 Answers

Intellij responded for me. I love that I could ask them and they would give me a prompt response. Here's the jist on what they said in response to my two conditions:

  1. wont kill incremental building:

It makes sense if compile phase wasn't executed before "Make". In other cases you'll get douoble compilation. It's by design and currently there are no plans to change it: http://youtrack.jetbrains.com/issue/IDEA-86493.

  1. Is shareable configuration with coworkers, since we'd all want the same config:

This information is stored in ".idea/misc.xml" and can be shared via vesrion control system.

The .idea/misc.xml is not very shareable in my opinion, due to all the variations in modules that could exist on different developer machines. We have a number of internal dependencies for our projects.

like image 76
Noremac Avatar answered Oct 22 '22 17:10

Noremac