One way could be to factor out the reusable bits out to a separate Component. That should make plugins lightweight and allow components to be used by more than just one Plugin.

Cheers,
Rahul


----- Original Message ----- From: "Brett Porter" <[EMAIL PROTECTED]>
To: "Maven Developers List" <dev@maven.apache.org>
Sent: Tuesday, July 11, 2006 1:19 PM
Subject: Re: A plugins nature


There shouldn't be any reason you can't test as POJOs now (as long as you add getters and setters). I was initially reluctant about the extent of using the testing harness for testing - they do seem more like integration tests, but it has really been used as an assistant for populating values (and probably doesn't even go far enough there - it could populate the default expressions for you, for example).

Anyway, I'm interested to talk about this some more - the most recent plugin I worked on was the release plugin where all the code was outside the mojos and they were just a thin wrapper for the Maven specifics (like surefire, etc).

I think this is the right level at design, but I'm not sure about packaging (do we always split it into two parts, or do we want to be able to use the java from a mojo jar as is?)

- Brett

On 11/07/2006 7:46 AM, Mike Perham wrote:
I would like to see plugins be made a little more independent from
Maven. You know how J2EE code is difficult to test due to the need for a container? Well, Maven is the container for plugins and that need for
a container makes it more difficult than necessary to test and reuse
plugins. There's no reason why plugins couldn't become POJOs which have
a MOJO container configuration layer.  Unit tests could easily
instantiate the POJOs for simple testing and a more thorough system
(like the maven-plugin-test-harness) could be used to integration test
the whole plugin.

-----Original Message-----
From: Jochen Wiedmann [mailto:[EMAIL PROTECTED] Sent: Monday, July 10, 2006 4:34 PM
To: Maven Developers List
Subject: A plugins nature

Hi,

in the last weeks I have thought a little bit about Maven plugins. The
initial question was my desire to reuse another plugin.

There are good reasons for reusing plugins. As an example, think of a
plugin, which creates a jar file. Might be the retro* plugins or
something like that.I would think it makes sense to reuse the jar
plugin in such a case.

The problem with reusing plugins is that they consist in fact of two
parts: One part is the lifecycle management. The other part is the
actual code. For example, the jar plugin contains some rules which
ensure that it is called in the "package" phase. Besides, there is
code which actually creates a jar file based on a configuration.

The point I am trying to make is that such a plugin should possibly be
split into these two parts. If so, the implementation part might be
reused, while the lifecycle management part might still perform its
task.

What do you think?

Jochen



--
Apache Maven - http://maven.apache.org/
Better Builds with Maven - http://library.mergere.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to