You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Leopoldo Agdeppa III (JIRA)" <ji...@codehaus.org> on 2007/06/08 11:38:59 UTC

[jira] Created: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
-----------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: MNG-3042
                 URL: http://jira.codehaus.org/browse/MNG-3042
             Project: Maven 2
          Issue Type: Bug
          Components: Plugin API
            Reporter: Leopoldo Agdeppa III


I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MPLUGIN-164) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "lisak (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MPLUGIN-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=282906#comment-282906 ] 

lisak commented on MPLUGIN-164:
-------------------------------

+1 annotations 
[MPLUGIN-189|http://jira.codehaus.org/browse/MPLUGIN-189]
[MNG-2521|http://jira.codehaus.org/browse/MNG-2521]

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MPLUGIN-164
>                 URL: https://jira.codehaus.org/browse/MPLUGIN-164
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Bug
>          Components: Java Plugins
>            Reporter: Leopoldo Agdeppa III
>            Assignee: Benjamin Bentmann
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Fox updated MNG-3042:
---------------------------

    Fix Version/s:     (was: Reviewed Pending Version Assignment)
                   2.1

inheriting mojos across plugins is not currently supported. We should consider for 2.1

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: 2.1
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Stuart McCulloch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_108237 ] 

Stuart McCulloch commented on MNG-3042:
---------------------------------------

you could try:

   http://www.ops4j.org/projects/pax/construct/maven-inherit-plugin


> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: Reviewed Pending Version Assignment
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Stuart McCulloch (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_124544 ] 

Stuart McCulloch commented on MNG-3042:
---------------------------------------

FYI, you only need to propagate values using reflection if you override the field, ie. you declare a field in your mojo that "hides" a field of the same name in original mojo. You only usually need to do this if you need to change the default, or want access to the field - although in the latter case you could use reflection to read the field rather than override it. ( interestingly, if the overridden field is a @parameter then your new field will be injected instead of the original - but if it's an @component then it appears the original field is injected rather than the original )

Note that you can read and write private fields using reflection - you just need to use setAccessible(true) on the field to make it accessible, as shown in:

   http://www.ops4j.org/projects/pax/construct/maven-pax-plugin/xref/org/ops4j/pax/construct/util/ReflectMojo.html

btw, in the maven-pax-plugin I extend a number of different mojos and override a couple of private fields, so I know this works in practice.


> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: Reviewed Pending Version Assignment
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Marvin Froeder (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_108111 ] 

Marvin Froeder commented on MNG-3042:
-------------------------------------

On the same boat...

Have the same need too.

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: Reviewed Pending Version Assignment
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Closed: (MPLUGIN-164) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPLUGIN-164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MPLUGIN-164.
-------------------------------------

    Resolution: Duplicate
      Assignee: Benjamin Bentmann

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MPLUGIN-164
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-164
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Bug
>          Components: Java Plugins
>            Reporter: Leopoldo Agdeppa III
>            Assignee: Benjamin Bentmann
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Andrew Lee Rubinger (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_127850 ] 

Andrew Lee Rubinger commented on MNG-3042:
------------------------------------------

Would appreciate the implementation to use annotations with retention=RUNTIME. :)

S,
ALR

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: 2.1
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Moved: (MPLUGIN-164) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPLUGIN-164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann moved MNG-3042 to MPLUGIN-164:
------------------------------------------------

      Component/s:     (was: Plugin API)
                   Java Plugins
    Fix Version/s:     (was: 3.x)
              Key: MPLUGIN-164  (was: MNG-3042)
          Project: Maven 2.x Plugin Tools  (was: Maven 2 & 3)

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MPLUGIN-164
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-164
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Bug
>          Components: Java Plugins
>            Reporter: Leopoldo Agdeppa III
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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

        

[jira] Commented: (MNG-3042) Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.

Posted by "Petar Tahchiev (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_118272 ] 

Petar Tahchiev commented on MNG-3042:
-------------------------------------

I have the same problem - I want to extend the surefire plugin and every time I run it, I get a null-pointer exception, because the instant variables are null. According to maven-inherit plugin I have to propagate the fields using reflection. Well, propagation in my case does not work, because the fields in the surefire plugin are all private :-(, and I get a:
 
can not access a member of class org.apache.maven.plugin.surefire.SurefirePlugin with modifiers "private"

exception. 

Any other suggestions?

> Extending a Mojo Class and used in a new Mojo Project, parameter fields in the parent mojo are not set, this disables reuse of existing mojo project.
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-3042
>                 URL: http://jira.codehaus.org/browse/MNG-3042
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugin API
>            Reporter: Leopoldo Agdeppa III
>             Fix For: Reviewed Pending Version Assignment
>
>
> I have an Existing maven-plugin-a and I want to extend its functionality and put it in maven-plugin-b, so what i did is I put the the maven-plugin-a as a dependecy in maven-plugin-b and extended the mojo class from A, the issue on this is that paramter fields from A is not set, when I used plugin-B, I think this disables reusing and extending of mojos

-- 
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