Tom:

That was it!  I'm in business now with my templates inside the plugin.

Thanks,

David

On 11/11/06, Tom Huybrechts <[EMAIL PROTECTED]> wrote:

Check the value of classLoader.getResource(...). This should be a URL
in the form to a resource inside a jar. I don't think turning this
into a string and passing that to new File() will help. Instead try
using getting the resource as a stream.

InputStream is = getClass().getClassLoader().getResourceAsStream(...);
Reader reader = new InputStreamReader(is);


On 11/11/06, David Whitehurst <[EMAIL PROTECTED]> wrote:
> Can someone tell me how to get the maven plugin classloader?  Or tell me
if
> that's I can't obtain the reference file as such ... from a plugin.javafile
> e.g.
>
>             ClassLoader classLoader = this.getClass().getClassLoader();
>             File file = new File(classLoader.getResource
> (getLocalProperties().getProperty("templateName")).toString());
>             FileReader reader = new FileReader(file);
>
> The templateName is a String e.g.
>
> webstuff/mytemplate.ftl
>
> And it resides in the plugin jar at /webstuff/mytemplate.ftl .  I
checked
> the jar in the .m2 repo.  Is my FileNotFoundException because I am using
the
> wrong classloader?  And, if so, what classloader, and how do I get it?
>
>
> Thanks,
>
> David
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to