You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alessio Pace <al...@gmail.com> on 2007/05/17 19:47:33 UTC

[m2] Problem extending a MOJO: incongruency in default @parameter value

Hi,

I'm trying to write a MOJO as an extension of the "exec-maven-plugin", the
only purpose of it is to allow application specific parameter names in the
pom, instead of the various <argument> tags.

So, my project has the exec-maven-plugin as a <dependency>, and subclasses
one of the classes of the former
plugin (specifically, the ExecJavaMojo class). Code compiles and builds but
strangely, a default parameter value declared as such in the original MOJO:

/* @parameter expression="${exec.includeProjectDependencies}"
default-value="true"
*/
private boolean includeProjectDependencies;

has value *false* when it is evaluated in mysubclass!! No manipulations are
made on that field by the super class, it's only read in order to do
something or something else.

I can't really explain what happens, can someone give me a clue?

Thanks in advance,

-- 
Alessio Pace.

Re: [m2] Problem extending a MOJO: incongruency in default @parameter value

Posted by Steven Rowe <sa...@syr.edu>.
Hi Alessio,

I'm a Maven newbie, and am only responding because no one else has...

I have seen a couple of messages to the effect that plugin extension is
not supported by the Maven architecture.

See this thread for a couple of workarounds:

  <http://www.nabble.com/Reuse-plug-in-code-tf3564036s177.html#a9954824>

Also, though this particular question is more about Maven than any one
plugin, it may be useful for you to ask questions about Mojo Project
plugins on the Codehaus Mojo Project mailing lists:

  <http://mojo.codehaus.org/mail-lists.html>

Steve

Alessio Pace wrote:
> Hi,
> 
> I'm trying to write a MOJO as an extension of the "exec-maven-plugin", the
> only purpose of it is to allow application specific parameter names in the
> pom, instead of the various <argument> tags.
> 
> So, my project has the exec-maven-plugin as a <dependency>, and subclasses
> one of the classes of the former
> plugin (specifically, the ExecJavaMojo class). Code compiles and builds but
> strangely, a default parameter value declared as such in the original MOJO:
> 
> /* @parameter expression="${exec.includeProjectDependencies}"
> default-value="true"
> */
> private boolean includeProjectDependencies;
> 
> has value *false* when it is evaluated in mysubclass!! No manipulations are
> made on that field by the super class, it's only read in order to do
> something or something else.
> 
> I can't really explain what happens, can someone give me a clue?
> 
> Thanks in advance,
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org