[ http://jira.codehaus.org/browse/MNG-1248?page=all ]
Brett Porter closed MNG-1248:
-----------------------------
Assign To: Brett Porter
Resolution: Won't Fix
cannot inherit metadata across plugins
> configuration inheritence: base class parameters not correctly initialized
> --------------------------------------------------------------------------
>
> Key: MNG-1248
> URL: http://jira.codehaus.org/browse/MNG-1248
> Project: Maven 2
> Type: Bug
> Reporter: Jerome Lacoste
> Assignee: Brett Porter
>
>
> Haven't been able to identify the exact reason:
> Here's my use case:
> AbstractWarMojo has a parameter called project accessible by sub-classes
> using a getProject() method.
> /**
> * The maven project.
> *
> * @parameter expression="${project}"
> * @required
> * @readonly
> */
> private MavenProject project;
> The execution will show that the project parameter has not been initialized
> correctly.
> I.e. the following code:
> getLog().debug( "project " + this.getProject() ); // from base class
> getLog().debug( "project2 " + this.project2 );
> will display:
> [DEBUG] project null
> [DEBUG] project2 [EMAIL PROTECTED]
> My work-around was to define a new field in the sub-class called project2.
> I don't see a difference between my mojo and the WarMojo in the way they are
> configured.
> I've tried to add
> * @requiresDependencyResolution runtime
> * @requiresProject
> * @inheritedByDefault true
> by none of this helped.
> here's the WarMojo META-IN/plugin.xml header
> <goal>war</goal>
> <description>Build a war/webapp.</description>
> <requiresDependencyResolution>runtime</requiresDependencyResolution>
> <requiresDirectInvocation>false</requiresDirectInvocation>
> <requiresProject>true</requiresProject>
> <requiresReports>false</requiresReports>
> <aggregator>false</aggregator>
> <requiresOnline>false</requiresOnline>
> <inheritedByDefault>true</inheritedByDefault>
> <phase>package</phase>
> <implementation>org.apache.maven.plugin.war.WarMojo</implementation>
> <language>java</language>
> <instantiationStrategy>per-lookup</instantiationStrategy>
> <executionStrategy>once-per-session</executionStrategy>
> Here's my plugin header
> <goal>jnlp</goal>
> <description>Packages a jnlp application.</description>
> <requiresDependencyResolution>runtime</requiresDependencyResolution>
> <requiresDirectInvocation>false</requiresDirectInvocation>
> <requiresProject>true</requiresProject>
> <requiresReports>false</requiresReports>
> <aggregator>false</aggregator>
> <requiresOnline>false</requiresOnline>
> <inheritedByDefault>true</inheritedByDefault>
> <phase>compile</phase>
> <implementation>org.codehaus.mojo.webstart.JnlpMojo</implementation>
> <language>java</language>
> <instantiationStrategy>per-lookup</instantiationStrategy>
> <executionStrategy>once-per-session</executionStrategy>
> They are basically identical. The invocation still fails.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]