You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Vincent Massol (JIRA)" <ji...@codehaus.org> on 2005/12/21 21:36:57 UTC
[jira] Created: (MNG-1886) Need way to share code between report
mojos and main build mojos
Need way to share code between report mojos and main build mojos
----------------------------------------------------------------
Key: MNG-1886
URL: http://jira.codehaus.org/browse/MNG-1886
Project: Maven 2
Type: Improvement
Components: Plugin API
Versions: 2.0.1
Reporter: Vincent Massol
For example in the clover plugin i have both report mojos and main build mojos. They need to share lots of configuration elements and common methods but it's not easy to do so because each type needs to extend either AbstractMavenReport or AbstractMojo. Of course I could not extend AbstractMavenReport and instead implement the interface but then I'll have to reimplement all its methods.
--
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Closed: (MNG-1886) Need way to share code between report
mojos and main build mojos
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-1886?page=all ]
Brett Porter closed MNG-1886:
-----------------------------
Assign To: Brett Porter
Resolution: Won't Fix
can you elaborate on what you mean here?
If they are sharing types - there is no reason this can't be done with a subelement (eg, like MavenArchiveConfiguration in jar, war, etc).
Other things might be sharable by the plugin context.
Please reopen if neither of these address your needs.
> Need way to share code between report mojos and main build mojos
> ----------------------------------------------------------------
>
> Key: MNG-1886
> URL: http://jira.codehaus.org/browse/MNG-1886
> Project: Maven 2
> Type: Improvement
> Components: Plugin API
> Versions: 2.0.1
> Reporter: Vincent Massol
> Assignee: Brett Porter
>
>
> For example in the clover plugin i have both report mojos and main build mojos. They need to share lots of configuration elements and common methods but it's not easy to do so because each type needs to extend either AbstractMavenReport or AbstractMojo. Of course I could not extend AbstractMavenReport and instead implement the interface but then I'll have to reimplement all its methods.
--
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Updated: (MNG-1886) Need way to share code between report
mojos and main build mojos
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-1886?page=all ]
Brett Porter updated MNG-1886:
------------------------------
Fix Version: 2.1
> Need way to share code between report mojos and main build mojos
> ----------------------------------------------------------------
>
> Key: MNG-1886
> URL: http://jira.codehaus.org/browse/MNG-1886
> Project: Maven 2
> Type: Improvement
> Components: Plugin API
> Versions: 2.0.1
> Reporter: Vincent Massol
> Assignee: Brett Porter
> Fix For: 2.1
>
>
> For example in the clover plugin i have both report mojos and main build mojos. They need to share lots of configuration elements and common methods but it's not easy to do so because each type needs to extend either AbstractMavenReport or AbstractMojo. Of course I could not extend AbstractMavenReport and instead implement the interface but then I'll have to reimplement all its methods.
--
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Commented: (MNG-1886) Need way to share code between report
mojos and main build mojos
Posted by "Vincent Massol (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-1886?page=comments#action_54344 ]
Vincent Massol commented on MNG-1886:
-------------------------------------
I'm talking about sharing configuration elements (fields).
Here's an example:
<configuration>
<cloverDatabase>...</cloverDatabase>
<jdk>...</jdk>
[...]
Is there any doc on the plugin context? I don't think this is what I'm after though.
Try writing a plugin which has both reporting mojos and main mojos and you'll see what I mean. Alternatively you could have a look at the clover plugin. Search for MNG-1886 in the code and you'll find the places where it's awkward and would ideally require a better design.
This is an issue about code duplication, maintenance and consistency in general. I think the issue's title can be changed to; "How to share configuration elements between mojos when inheritance is not possible".
The example you give about the MavenArchiveConfiguration require the introduction of another level of configuration for users. I'm talking about sharing the top level.
Thanks
> Need way to share code between report mojos and main build mojos
> ----------------------------------------------------------------
>
> Key: MNG-1886
> URL: http://jira.codehaus.org/browse/MNG-1886
> Project: Maven 2
> Type: Improvement
> Components: Plugin API
> Versions: 2.0.1
> Reporter: Vincent Massol
> Assignee: Brett Porter
>
>
> For example in the clover plugin i have both report mojos and main build mojos. They need to share lots of configuration elements and common methods but it's not easy to do so because each type needs to extend either AbstractMavenReport or AbstractMojo. Of course I could not extend AbstractMavenReport and instead implement the interface but then I'll have to reimplement all its methods.
--
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
[jira] Reopened: (MNG-1886) Need way to share code between report
mojos and main build mojos
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-1886?page=all ]
Brett Porter reopened MNG-1886:
-------------------------------
ok, there's something else here. I guess its going to be something like MavenArchiveConfiguration, but with a @parameter nested="false" or something like that. Won't be done before 2.1 if at all.
As a side note, AbstractMavenReport already extends AbstractMojo so you can achieve this anyway, but it means making a report of your mojo. A bit ugly.
I think there is an overall need to improve configurability of plugins (eg, validation of elements inside nested types, more sharing, etc).
> Need way to share code between report mojos and main build mojos
> ----------------------------------------------------------------
>
> Key: MNG-1886
> URL: http://jira.codehaus.org/browse/MNG-1886
> Project: Maven 2
> Type: Improvement
> Components: Plugin API
> Versions: 2.0.1
> Reporter: Vincent Massol
> Assignee: Brett Porter
>
>
> For example in the clover plugin i have both report mojos and main build mojos. They need to share lots of configuration elements and common methods but it's not easy to do so because each type needs to extend either AbstractMavenReport or AbstractMojo. Of course I could not extend AbstractMavenReport and instead implement the interface but then I'll have to reimplement all its methods.
--
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org