Gradle hides files when building a war

My project tree:

 /project
|
|--> /src
|    |-->/main
|        |-->/webapp
|            |--> a lot of folders here including /files with doc file inside
|--> build.gradle

when I put only in the build.gradle file apply plugin 'war', it puts everything in the war file during assembly, except for the doc file from the directory/files

I read Gradle docs , so add

war{
    from 'src/main/webapp/files'
}

to the build.gradle file, after that my war file has become larger in size, but the necessary file is not there.

How to add a file from a directory /filesto a war directory /files?

UPDATE

After adding this project to the multi-project build, the problem disappeared. I don’t know what the matter is.

+4
source share
1 answer

I believe the syntax you are looking for is:

war {
  from 'src/main/webapp/files' into 'files'
}

src/main/webapp/files files WAR (, my-app.war/files)

Gradle war , , , , .

0

Source: https://habr.com/ru/post/1525607/


All Articles