[jira] Created: (MPLUGIN-80) Detection of report goals always fails due to class loader separation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MPLUGIN-80) Detection of report goals always fails due to class loader separation

JIRA jira@codehaus.org
Detection of report goals always fails due to class loader separation
---------------------------------------------------------------------

                 Key: MPLUGIN-80
                 URL: http://jira.codehaus.org/browse/MPLUGIN-80
             Project: Maven 2.x Plugin Tools
          Issue Type: Bug
          Components: API, Plugin Plugin
            Reporter: Benjamin Bentmann


{{PluginUtils}} simply invokes {{Class.forName(String)}} to load a mojo class from the current project using its plugin class loader. However, as outlined in [Guide to Maven Classloading|http://maven.apache.org/guides/mini/guide-maven-classloading.html], Maven plugins have no direct access to the classes of the current project.

Besides, wouldn't the maven-plugin-plugin's {{report}} goal need {{@execute phase="compile"}} in order to ensure the mojo classes are existent prior to try to load them?

Not sure about that but maybe it's worth to extend the mojo descriptor with a flag "report" such that this info could be retrieved without reflection in some far future but is derived by the goal extractors.

P.S: You don't need to instantiate a class just to do {{instanceof}} checking. To check for a report mojo simply do:
{code:java}
MavenReport.class.isAssignableFrom( clazz );
{code}

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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (MPLUGIN-80) Detection of report goals always fails due to class loader separation

JIRA jira@codehaus.org

     [ http://jira.codehaus.org/browse/MPLUGIN-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Siveton closed MPLUGIN-80.
----------------------------------

         Assignee: Vincent Siveton
       Resolution: Fixed
    Fix Version/s: 2.4

Fixed and snapshots redeployed

> Detection of report goals always fails due to class loader separation
> ---------------------------------------------------------------------
>
>                 Key: MPLUGIN-80
>                 URL: http://jira.codehaus.org/browse/MPLUGIN-80
>             Project: Maven 2.x Plugin Tools
>          Issue Type: Bug
>          Components: API, Plugin Plugin
>            Reporter: Benjamin Bentmann
>            Assignee: Vincent Siveton
>             Fix For: 2.4
>
>
> {{PluginUtils}} simply invokes {{Class.forName(String)}} to load a mojo class from the current project using its plugin class loader. However, as outlined in [Guide to Maven Classloading|http://maven.apache.org/guides/mini/guide-maven-classloading.html], Maven plugins have no direct access to the classes of the current project.
> Besides, wouldn't the maven-plugin-plugin's {{report}} goal need {{@execute phase="compile"}} in order to ensure the mojo classes are existent prior to try to load them?
> Not sure about that but maybe it's worth to extend the mojo descriptor with a flag "report" such that this info could be retrieved without reflection in some far future but is derived by the goal extractors.
> P.S: You don't need to instantiate a class just to do {{instanceof}} checking. To check for a report mojo simply do:
> {code:java}
> MavenReport.class.isAssignableFrom( clazz );
> {code}

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