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 [EMAIL 
PROTECTED] 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 via email to