Deploy Gadle built Ear using eclipse on wilfdfly

I’m trying to deploy the Ear file which contains the META-INF folder and had a dependency on the war file but some how I’m not able to add the META-INF folder in the ear file. I tried keeping the META-INF folder in the application folder(src/main/application/META-INF/) but then while publishing ear from eclipse it’s throwing a null pointer exception.
Gradle : 7.5
Wildfly: 8
Below I’m pasted my build.gradle file.
Thanks in advance for any help.

buildscript {
	ext.repos = {
		maven {
			credentials {
				username = "${ARTIFACTORY_USER}"
				password = "${ARTIFACTORY_PASSWORD}"
	repositories repos

plugins {
	id 'java'
    id 'maven-publish'
    id 'eclipse-wtp'
    id 'idea'
    id 'ear'

group = ''
description = 'Dragon6'
version = 'xyz'

repositories repos


dependencies {
	earlib project(':Dao')
    earlib 'javax.servlet:javax.servlet-api:3.0.1'
    deploy project(path: ":Dragon6Web", configuration: "archives")

tasks.withType(Ear) {
   duplicatesStrategy = DuplicatesStrategy.EXCLUDE

	archiveName = 'Dragon6.ear'

// Define the EAR configuration

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'