mirror of https://github.com/apache/maven.git
MNG-2827 pull the entry from the expression documenter using a method that works from the command line and in an embedded environment.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@512860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d1ee49281
commit
37692fbea1
|
@ -139,32 +139,6 @@ public class ExpressionDocumenter
|
|||
private static ClassLoader initializeDocLoader()
|
||||
throws ExpressionDocumentationException
|
||||
{
|
||||
String myResourcePath = ExpressionDocumenter.class.getName().replace( '.', '/' ) + ".class";
|
||||
|
||||
URL myResource = ExpressionDocumenter.class.getClassLoader().getResource( myResourcePath );
|
||||
|
||||
String myClasspathEntry = myResource.getPath();
|
||||
|
||||
myClasspathEntry = myClasspathEntry.substring( 0, myClasspathEntry.length() - ( myResourcePath.length() + 2 ) );
|
||||
|
||||
if ( myClasspathEntry.startsWith( "file:" ) )
|
||||
{
|
||||
myClasspathEntry = myClasspathEntry.substring( "file:".length() );
|
||||
}
|
||||
|
||||
URL docResource;
|
||||
try
|
||||
{
|
||||
docResource = new File( myClasspathEntry ).toURL();
|
||||
}
|
||||
catch ( MalformedURLException e )
|
||||
{
|
||||
throw new ExpressionDocumentationException(
|
||||
"Cannot construct expression documentation classpath resource base.",
|
||||
e );
|
||||
}
|
||||
|
||||
return new URLClassLoader( new URL[] { docResource } );
|
||||
return ExpressionDocumenter.class.getClassLoader();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue