Wednesday, October 19, 2016

How to let IDEA auto import pom.xml with Annotation Processors defined

Leave a Comment

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?

1 Answers

Answers 1

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

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment