How can I make gradle include * .ftl files in a war file

I have the following structure:

src/main/java/com/company/SomeJavaFile.java src/main/java/com/company/template_file.ftl 

When I create an assembly using gradle, * .ftl files are not included in the war file.

How can I make gradle include them in a war file?

+7
source share
3 answers

Ok, found it. You simply add the following line to the assembly file:

gradle.build file (add the following line):

 sourceSets.main.resources.srcDir 'src/main/java' 

Got a response from the following discussion topic:

http://gradle.1045684.n5.nabble.com/Copy-non-java-files-into-the-target-directory-td1432058.html

+4
source

Another solution would be to put your *.ftl files in the src/main/resources directory.

+8
source

Why not put them in src / main / webapp, where, if you used them, * .jsp files would go?

0
source

All Articles