On 5/14/08, mraible <[EMAIL PROTECTED]> wrote:

<snip>

>  Additionally, I have the following FreeMarker code that I want to read files
>  from the plugin:
>
>       Configuration cfg = new Configuration();
>       cfg.setDirectoryForTemplateLoading(new File("src/test/resources"));

^^^^^^
this will not work in embedded environment. The file instance can
never be relative to the JVM basedir. It might not even work for
multimodule builds I guess.


Milos

>
>       cfg.setObjectWrapper(new DefaultObjectWrapper());
>       Map<String, Object> root = new HashMap<String, Object>();
>       root.put("package", packageName);
>       root.put("urlMap", urls);
>
>       Template template = cfg.getTemplate("APIClass.ftl");
>       String output =
>  FreeMarkerTemplateUtils.processTemplateIntoString(template, root);
>
>  The directoryForTemplateLoading and template works if I put these files in
>  my project that's executing the plugin. However, I'd rather load the
>  defaults from the plugin and allow overriding in the project. I realize this
>  is likely a FreeMarker question, but I figured it didn't hurt to ask.
>
>  Thanks,
>
>  Matt
>
>
>
>
>  --
>  View this message in context: 
> http://www.nabble.com/Adding-project-dependencies-to-a-plugin-tp17199492p17220105.html
>
> Sent from the mojo - user mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to