maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Kleint <mkle...@gmail.com>
Subject Re: annotations support in compiler mojo
Date Thu, 25 Feb 2010 08:47:47 GMT
Well, the javac executable is caapable of doing both jobs (compile and
process annotations) simultaneously. And with reasonable defaults we can
make the annotation processing work out of the box for majority of people.
Having a special plugin for it, with comfiguration etc would make it more
complicated to setup and maintain.

Milos

On Wed, Feb 10, 2010 at 3:52 PM, Brian Fox <brianf@infinity.nu> wrote:

> Does it make sense to create a plugin specifically for annotation
> processing?
>
> On Sat, Jan 30, 2010 at 3:06 AM, Milos Kleint <mkleint@gmail.com> 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 <mkleint@gmail.com> 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: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message