Hi Christophe,

Good to see that you're using maven in your organisation.

Yes, it is possible to map complex types in Mojo. However, you need to pay
attention to the following:

- The ComplexObject needs to be public with a default public constructor and
needs to be in the same package as your Mojo
- Notation is a bit different, I would have a look to the maven2 EAR plugin
[1] which has this kind of functionnality

In any case, running mvn in debug will output what maven (plexus actually)
is doing with your parameter regarding DI.

A book is about to be released and it will contain a chapter about plugin
development.

Cheers,
Stéphane

[1]
http://svn.apache.org/viewcvs.cgi/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/(see
EarModule and subclasses)



On 3/30/06, Christophe Grosjean <[EMAIL PROTECTED]>
wrote:
>
>  Hi,
>
>
>
> A question  about the configuration mappings… Does the mapping of Maven
> project properties to Mojo fields also
>
> work for any complex objects used to configure the plugin?
>
>
>
> In other words, in the following code, will the 'project' field of the
> ComplexObject parameter be assigned ?
>
>
>
>
>
>
>
> public class SomeMojo extends AbstractMojo {
>
>
>
>       /**
>
>       * @parameter
>
>       */
>
>       private ComplexObject complexObject;
>
>
>
> }
>
>
>
> public class ComplexObject {
>
>
>
>       /**
>
>      * The maven project.
>
> *
>
> * @parameter expression="${project}"
>
> * @required
>
> * @readonly
>
> */
>
>       private MavenProject project;
>
>
>
> }
>
>
>
> Thanks for your answer,
>
>
>
> Christophe
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
.::You're welcome ::.

Reply via email to