EAR - Add xml file to META-INF dir

Hi,
I am using Gradle 4.10.2 and I am building an ear file, where I must put a jboss-deployment-structure.xml file into the META-INF folder of ear. On Internet, I see different plugins to generate jboss-deployment-structure.xml, but I can’t use it, because I am in a enteprise context. How can I put the xml file into META-INF folder of ear file?

Thank for your attention!
Bye!

Create the following directory structure:
src/main/application/META-INF

And copy your xml descriptors to it:
application.xml
jboss-deployment-structure.xml

Hi,
I try to use your solution, but the ear META-INF folder doesn’t contain the files.

Thanks a lot!

I resolved it.
I specify the appDirName in the ear task.

Thanks

That’s good. I’m not sure about your project structure or where your build.gradle is in relation, but the default appDirName defaults to src/main/application, so you shouldn’t have to specify anything.

./build.gradle
./src
./src/main
./src/main/application
./src/main/application/META-INF
./src/main/application/META-INF/jboss-deployment-structure.xml
./src/main/application/META-INF/application.xml

build.gradle

apply plugin: 'ear'