Author: jvanzyl Date: Wed Feb 28 09:32:23 2007 New Revision: 512860 URL: http://svn.apache.org/viewvc?view=rev&rev=512860 Log: MNG-2827 pull the entry from the expression documenter using a method that works from the command line and in an embedded environment.
Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java?view=diff&rev=512860&r1=512859&r2=512860 ============================================================================== --- maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java (original) +++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java Wed Feb 28 09:32:23 2007 @@ -139,32 +139,6 @@ 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(); } - }