Hi All, I'm working on a plugin, written in Groovy, where when it's invoked 
I 

want to load resources off the classpath of the project.  

For example, when the plugin is configured like so:

  <configuration>
   <request>request.xml</request>
  </configuration>

>From inside my plugin code, I want to be able to load the text of the 
>resource, 
contained in src/main/resources/request.xml (and presently in target/classes):

    /** @parameter */
   String request

   ...
          String requestXml = 
getClass().getClassLoader().getResourceAsStream(resource).text
   ...

I however get the exception: Cannot invoke method getText() on null object

I've used the above code in numerous projects to grab the test of a classpath 
resource, mostly during unit testing.  It appears to be that while the resource 
is on the classpath of the 

project using the plugin, its not available to the plugin itself?

Any insight is greatly appreciated.  Thanks!



      

Reply via email to