maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hobson <markhob...@gmail.com>
Subject Re: annotations support in compiler mojo
Date Wed, 10 Feb 2010 16:53:52 GMT
Late reply on this one, but I'm certainly interested in seeing apt
support added to maven-compiler-plugin.

There is already a separate plugin for apt over at Mojo,
apt-maven-plugin [1].  I worked on this a while back to get it into
shape and am currently using it in production.  I'd be happy to see
this superseded by the compiler plugin if it incorporates all of the
existing functionality.

Cheers,

Mark

[1] http://mojo.codehaus.org/apt-maven-plugin/

On 10 February 2010 15:21, nicolas de loof <nicolas.deloof@gmail.com> wrote:
> 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 <brianf@infinity.nu>
>
>> 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
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message