11

I am using QueryDsl, so my source depends on generated code.

FIRST

Whenever IDEA (auto) imports pom.xml, the following setting is always empty:

Build, Execution, Deployment -> Compiler -> Annotation Processors -> Annotation Processors

I have to set it manually, which is very troublesome.

SECOND

I have multi-modules using QueryDsl, which I want to be grouped into one profile with the QueryDsl com.mysema.query.apt.jpa.JPAAnnotationProcessor applied.

Build, Execution, Deployment -> Compiler -> Annotation Processors -> profile

I currently have to group these modules into one profile manually.

I also have to write a README and inform all members to follow the guide to set IDEA manually.


How can I config pom.xml, so that IDEA can fill these two settings automatically?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Raymond
  • 885
  • 10
  • 28

1 Answers1

3

I would recommend you add .idea/* under version control as well as the project .iml file.

Annotation Processors

Annotation Processors settings are stored in .idea/compiler.xml. Having all this under CVS will make it a lot easier for other developers to open the project as they will open a project file, not a pom file, already containing project settings, run configurations, etc.

Details onto what should go in CVS and what not could be found on the official IntelliJ guide on How to manage projects under Version Control Systems

SDekov
  • 9,276
  • 1
  • 20
  • 50
  • It should work, but is not a Maven friendly solution. – Raymond Oct 15 '16 at 20:29
  • Is there a Maven plugin to control generations of `.idea/*` ? – Raymond Oct 16 '16 at 12:07
  • For each time, the `pom.xml` is updated and re-auto-imported, the `.idea/compiler.xml` is also updated, so I am afraid the method will not work. – Raymond Oct 17 '16 at 02:53
  • It seems gradle has an 'idea' plugin, it should/may ease this painpoint. I will update this post if I sucessed. If it did, I will move my build tool from Maven to Gradle. – Raymond May 09 '18 at 01:27