[hibernate-dev] Build and AnnotationProcessors

Hardy Ferentschik hardy at hibernate.org
Wed Apr 17 12:08:28 EDT 2013


On 17 Jan 2013, at 5:32 PM, Steve Ebersole <steve at hibernate.org> wrote:

> As discussed a little in HHH-8140[1] and on the earlier Eclipse thread, 
> I'd like to look at simplifying the build a bit around making IDE setup 
> easier.  One thing that came to mind was looking at source generation.  
> Today we have source generation occur for:
> * Antlr
> * JAXB
> * JPA static metamodel gen
> * Logging
> 
> The first 2 rely on specific tools while the other 2 are generated via 
> AnnotationProcessors.
> 
> For the first 2, there is really not much to discuss aside from possibly 
> to consider adding those outputs to Git.  I'd actually be open to 
> considering that for JAXB.

Personally I would not check them in. In my world generated classes don't 
belong into the repository.

> But really it is the AnnotationProcessors I wanted to talk about. 
> Currently we apply the AnnotationProcessors in separate javac task 
> configurations.  I cannot remember all the reasons we decided to do it 
> this way originally.  But I know that one was wanting to be able to keep 
> the output of each (the generated sources) in dedicated directories[2].  

This reminds me of not so distant discussion on jboss-dev ;-)
I still believe it is nice to have a different output directory for each annotation 
processor and I also like the idea of keeping things separate in the build. 
IMO it is completely valid to run the processors separately from the main javac call.

I know this creates problems in the IDE setup, but the limiting factor in this case
is the IDE.

> But we could also just lump all the APT output into one single, separate 
> directory (target/generated-src/apt/main, target/generated-src/apt/test, 
> e.g.).  What this would gain us is the ability for the IDE to run APT as 
> part of normal javac.  It would be one less thing to set up when setting 
> up the IDE project.

Since I drive the build most of the time from the command line I don't care
that the IDE is not doing the APT processing. For me a nicely organised 
build outweighs simpler IDE setup. 

--Hardy




More information about the hibernate-dev mailing list