Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gradle

I have the following structure:

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

When I create a build using gradle, the *.ftl files dont get included in the war file.

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

like image 239
Basil Musa Avatar asked Sep 18 '11 05:09

Basil Musa


2 Answers

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

like image 187
rodion Avatar answered Sep 28 '22 07:09

rodion


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

gradle.build file (add the following line):

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

Got the answer from the following discussion thread:

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

like image 28
Basil Musa Avatar answered Sep 28 '22 05:09

Basil Musa