Gradle Script to Build EAR for Weblogic 12.2.1.1

We have created a customize project for our application. 1. EJB Project (which interacts with DB for data). 2. One Dynamic Web project which includes the above EJB project and publish some REST services. 3. One Enterprise Application Project which basically include above two projects.

Now we would like to build our ear from #3 project and deploy it on the weblogic 12.2.1.1 .

We have created a sample build.gradle script , it is building properly but while deploying the same into the weblogic , we found underlying class files of war file from dynamic web project and jar file from EJB project are not found.

build.gradle for my dynamic web project is

 apply plugin: 'maven'
 apply plugin: 'java'
 apply plugin: 'war'

  sourceCompatibility = 1.8
  targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
 }
 repositories {
 mavenLocal()
mavenCentral()
}
jar.enabled = false
description = 'WAR Module'
dependencies {
compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1'

testImplementation('org.junit.jupiter:junit-jupiter-api:5.2.0')
testCompile('org.junit.jupiter:junit-jupiter-params:5.2.0')
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0')
testCompile "org.mockito:mockito-core:2.+"
testCompile('org.mockito:mockito-junit-jupiter:2.18.3')

testCompile group: 'junit', name: 'junit', version:'4.12'
providedCompile group: 'javax', name: 'javaee-api', version:'7.0'
  providedCompile project(':coupa-model')
testCompile 'io.rest-assured:rest-assured:3.2.0'    }
war {
archiveName = baseName + '.' + extension
 }

build.gradle script for my EAR project is

apply plugin: 'ear'
 apply plugin: 'maven'
 apply plugin: 'java'

 sourceCompatibility = 1.8
 targetCompatibility = 1.8
 tasks.withType(JavaCompile) {
 options.encoding = 'UTF-8'
 }

 repositories {
  mavenLocal()
  mavenCentral()
 }

 description = 'EAR Module'


  dependencies {
   deploy project(':coupa-api')
   deploy project(path:':coupa-api', configuration:'archives')
  testCompile group: 'commons-httpclient', name: 'commons-httpclient',     version:'3.1'
  testCompile group: 'junit', name: 'junit', version:'4.12'

 }
ear {
 archiveName = baseName + '.' + extension
}

Can anyone help me with build.gradle for Weblogic 12c and why we are getting class related exception. I have not found any direct answer in any forum for Gradle and Weblogic combination.

Thank you in advance.