You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jerome Lacoste <je...@gmail.com> on 2007/03/15 11:29:40 UTC

guidelines to writing maven plugins considering that maven might be embeded

Hi,

further care must be taken when writing plugins considering that maven can
be embedded. Maven sort of acts as a container for code. And maven itself
can be embedded.

In particular, I haven't seen any documentation that clearly states what the
plugin developers should do to ensure their plugin is a good maven citizen.


We had this little asynchronous Jira chat on the MEXEC-20 issue:

--------------------------------
> Are there any guidelines to thread / memory management when it comes to
potential embedding ? There should be.

Miklos kleint said:

yup. there should be some docs, but so far it's a moving target generally
and I keep figuring out things that are bad for embedding on the run...

1. use of System.getProperty() in plugins or non-forked threads are bad.
(both get and set)
2. Runtime's shutdownhooks are problematic.
3. setting a context classloader is bad.
4. assuming a working directory (by constructing java.io.File with relative
path) is also troublesome.
5. static memory caches are problem but mostly for components, plugins are
ok there.
--------------------------------

This should probably be expanded and moved to a wiki or the doc. Comments ?

For discussion background see:
http://jira.codehaus.org/browse/MEXEC-20#action_89457

Cheers,

J