You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dan Godfrey <da...@gmail.com> on 2013/01/03 18:00:40 UTC

HelpMojo not being compiled when using annotations

Hi,

I'm having some issues getting the HelpMojo generated when using the
maven-plugin-plugin. I've updated to use the java annotations instead of
the javadoc versions.

The issue as far as I can see is that, the helpmojo goal needs to be
executed in the process-classes phase, otherwise there won't necessarily be
any classes in target\classes from which to read the annotations. However,
as the process-classes phase is after the compile phase, the source
generated for HelpMojo in target/generated-sources/plugin is never compiled
into target/classes, and hence never included in the jar. It's a bit of a
chicken & egg problem.

If it is executed in the generate-sources phases, (the default I believe)
then the build fails after a clean as there are no classes in
target/classes with any annotations, well no classes at all.

Thanks,
Dan.

Re: HelpMojo not being compiled when using annotations

Posted by Dan Godfrey <da...@gmail.com>.
Thanks.... I was missing the
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> workaround,
by using the suggested alternative in the first comment @
http://jira.codehaus.org/browse/MNG-5346. (which I don't think works)

I raised https://jira.codehaus.org/browse/MPLUGIN-238 (with an attached
project) to suggest stopping the helpmojo goal from extracting all of the
mojo metadata, as that appears to be the underlying problem I'm having.

Regards,
Dan.

Re: HelpMojo not being compiled when using annotations

Posted by Anders Hammar <an...@hammar.net>.
Not sure I follow, but this works just fine for the core Apache Maven
plugins (that use annotations) so you must be doing something wrong. Please
have a look at the source for any of those plugins for reference.
I assume you've tried the latest version of the plugin?

If you still think it's a problem, file a ticket with a small project that
reproduces the issue.

/Anders


On Thu, Jan 3, 2013 at 6:00 PM, Dan Godfrey <da...@gmail.com>wrote:

> Hi,
>
> I'm having some issues getting the HelpMojo generated when using the
> maven-plugin-plugin. I've updated to use the java annotations instead of
> the javadoc versions.
>
> The issue as far as I can see is that, the helpmojo goal needs to be
> executed in the process-classes phase, otherwise there won't necessarily be
> any classes in target\classes from which to read the annotations. However,
> as the process-classes phase is after the compile phase, the source
> generated for HelpMojo in target/generated-sources/plugin is never compiled
> into target/classes, and hence never included in the jar. It's a bit of a
> chicken & egg problem.
>
> If it is executed in the generate-sources phases, (the default I believe)
> then the build fails after a clean as there are no classes in
> target/classes with any annotations, well no classes at all.
>
> Thanks,
> Dan.
>