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>
* @version $Id$
* @goal report
* @execute phase="compile"
*/
public class PluginReport
extends AbstractMavenReport

View File

@ -185,6 +185,10 @@ public final class PluginUtils
try
{
classPathStrings = project.getCompileClasspathElements();
if ( project.getExecutionProject() != null )
{
classPathStrings.addAll( project.getExecutionProject().getCompileClasspathElements() );
}
}
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 = projectClassLoader;
}
Class clazz = null;
@ -342,7 +345,7 @@ public final class PluginUtils
* match the sequence of characters in <code>s</code> treated as a literal sequence. Slashes ('\') and dollar
* signs ('$') will be given no special meaning. TODO: copied from Matcher class of Java 1.5, remove once target
* platform can be upgraded
*
*
* @see <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html">java.util.regex.Matcher</a>
* @param s The string to be literalized
* @return A literal string replacement