MPLUGIN-80: Detection of report goals always fails due to class loader separation

o added @execute tag
o take care of the executed project

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@635233 13f79535-47bb-0310-9956-ffa450edef68
master
Vincent Siveton 2008-03-09 13:26:54 +00:00
parent 251256ef22
commit 8e95bdf7eb
2 changed files with 7 additions and 3 deletions

View File

@ -51,6 +51,7 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a> * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$ * @version $Id$
* @goal report * @goal report
* @execute phase="compile"
*/ */
public class PluginReport public class PluginReport
extends AbstractMavenReport extends AbstractMavenReport

View File

@ -185,6 +185,10 @@ public final class PluginUtils
try try
{ {
classPathStrings = project.getCompileClasspathElements(); classPathStrings = project.getCompileClasspathElements();
if ( project.getExecutionProject() != null )
{
classPathStrings.addAll( project.getExecutionProject().getCompileClasspathElements() );
}
} }
catch ( DependencyResolutionRequiredException e ) catch ( DependencyResolutionRequiredException e )
{ {
@ -204,9 +208,8 @@ public final class PluginUtils
} }
} }
URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), classLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ),
classLoader ); classLoader );
classLoader = projectClassLoader;
} }
Class clazz = null; Class clazz = null;