From 37692fbea1f43513d92e3fa251f8e14d8e3d27bd Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Wed, 28 Feb 2007 17:32:23 +0000 Subject: [PATCH] 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 --- .../plugin/ExpressionDocumenter.java | 28 +------------------ 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java b/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java index 8cde37cd84..10e50bf8b7 100644 --- a/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java +++ b/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java @@ -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(); } - }