Would such a dedicated plugin only apply annotation processing or replace compiler plugin ? This may implies duplicate configuration for compiler + annotation-processing plugins. Also consider slower build process as javac will need to parse source code 2 times.
(late) +1 for annotations support in maven-compiler-plugin Nicolas 2010/2/10 Brian Fox <[email protected]> > Does it make sense to create a plugin specifically for annotation > processing? > > On Sat, Jan 30, 2010 at 3:06 AM, Milos Kleint <[email protected]> wrote: > > can I read silence as lazy consensus to add annotation processing to the > > compiler plugin? > > > > Milos > > > > On Mon, Jan 25, 2010 at 2:48 PM, Milos Kleint <[email protected]> wrote: > > > >> Hello, > >> > >> I'd like to start a discussion about how annotations are supported in > maven > >> builds. I'm currently trying to use some NetBeans Platform based > annotations > >> in maven projects and I'm encountering some problems. > >> > >> 1. http://jira.codehaus.org/browse/MCOMPILER-98 - -sourcepath needs to > be > >> always set to have the annotations processed. fixed in latest plexus > >> compiler sources.. > >> 2. some annotation processors require resources to be present on the > >> sourcepath eg. one that generates java beans from schema or another one > that > >> checks for property bundle key presence. I'm not sure how to make this > >> generally available to the processor. resources themselves (in > >> src/main/resources) are not to be referenced I guess (as they could be > on > >> wrong <targetPath> or not filtered). So the only other option is to > include > >> the target/classes folder somehow with the correctly processed > resources. > >> Any other idea? > >> 3. Some annotation processors generate xml files or META-INF/services > >> content, some generate java files. the default output location for the > >> processor is target/classes, which is fine for xml files, but it's > >> inconvenient to generate java files there as they end up in the jar file > >> then. I've tried to configure the compiler to use > >> target/generated-sources/annotations as the output folder for sources > (via > >> -s <dir> switch). Unfortunately there are problems associated with that > >> approach. > >> a. the folder needs to exist up front or the compiler chokes on it. > >> Doable with some ant-run scripting, but ugly. > >> b. what to do with the resources there that need to be copied to the > >> target/classes folder? Doable with resources:copy-resources but again > ugly. > >> 4. reporting from the annotations processors is broken - > >> http://jira.codehaus.org/browse/MCOMPILER-66 > >> > >> > >> Issue http://jira.codehaus.org/browse/MCOMPILER-75 seems to be > dedicated > >> to annotation support. Is anyone actively working on it? I'm > volunteering to > >> add some of the required switches as prameters for the compiler mojo, > but > >> I'm unsure how to proceed. Is it ok just to add the required stuff as > mojo > >> params, even if it will be unused by some of the other compilers? and > even > >> by the non 1.6 javac compilers? or have some new ways fo configuring the > >> mojo (as pointed out in http://jira.codehaus.org/browse/MCOMPILER-14)? > >> > >> Thanks for any comments. > >> > >> Milos > >> > >> PS: I can provide a sample project with the above mentioned annotations > >> being used if there is interest. > >> > >> > >> > >> > >> > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
