This answer addresses this problem for a Grails 2 project, but does not work for a Grails 3 project. For instance, in a Grails 2 project I was able to put an xsl file in /src/groovy/myapp/resources/
and load it similar to what the linked answer suggested...
this.class.getClassLoader().getResourceAsStream("myapp/resources/my_xsl.xsl") // Returns an java.io.InputStream
...but that does not work for Grails 3 when the same file is placed in src/main/groovy/myapp/resources/
.
You can use src/main/resources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With