Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Lifecycle mapping issue

I'm attempting to write a project configurator for Jamon
(www.jamon.org), a templating engine which generates java code from
template sources. Jamon has a maven plugin whose mojo binds to the
generate-sources phase, but it also has an eclipse plugin, so the
project configurator, upon detecting the jamon-maven-plugin, should add
the Jamon nature to the eclipse project.

The problem is that the Jamon nature requires javanature to be on the
project. It needs to add the generated sources directory to the eclipse
project's classpath. However, because the jamon-maven-plugin's mojo
binds to the generate-sources-phase, the Jamon project configurator is
run prior to the java configurator
(org.eclipse.m2e.jdt.javaconfigurator). Thus, when trying to add
"jamonnature" to the project, eclipse complains that jamonnature is
missing the prerequisite javanature.

Is there a recommended way to handle this sort of situation? The only
thing I can think of at the moment is to create two configurators. One
would be a dummy configurator attached to the Jamon mojo; this would
keep m2e from complaining about the jamon plugin execution not being
covered. Then attach the "real" Jamon configurator to the
maven-compiler-plugin as a secondary configurator. While this might
work, it doesn't feel particularly clean, and I wouldn't be surprised to
see a kludge like that break in a future release of m2e.

  - Ian

CONFIDENTIALITY NOTICE:  This message is intended only for the use and review of the individual or entity to which it is addressed and may contain information that is privileged and confidential.  If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message solely to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.  If you have received this communication in error, please notify sender immediately by telephone or return email.  Thank you.


Back to the top