Ear file depends on EJB & WAR from subproject

I am building an EAR file that contains an EJB and a WAR file both built from the same subproject. The EAR files is being created with only the .war file. In cases where I have a project that is just .jar it includes in the .ear file. I’m trying to replace Ant script, and would like to not have to move src. How do I get the ear to have the :core:jar and the :core:war artifacts ?

settings.xml
include 'core'

build.gradle

apply plugin: 'ear'
defaultTasks 'assemble'
dependencies {
    deploy project(path: ':core', configuration: 'archives')
    deploy project(path: ':persist', configuration: 'archives')
}

->core:
build.gradle:

plugins {
    id 'java-library'
    id 'war'
}

tasks.withType(Jar) {
   archivesBaseName = 'core'
}

tasks.withType(War) {
   archivesBaseName = 'my-war'
}

dependencies {
    api 'xerces:xerces:2.4.0'
}

I got it. I change the core/build.xml to:

        plugins {
            id 'java-library'
            id 'war'
        }

        tasks.withType(Jar) {
           archivesBaseName = 'my-jar'
           
           jar {
              from ('META') {
                    into 'META-INF'
                    includes = [ 'ejb-jar.xml']
              }
           }
           
        }

        tasks.withType(War) {
           archivesBaseName = 'my-web'
        }

        task coreJar(type: Jar) {
            archivesBaseName = 'core'
            from sourceSets.main.output
            archiveFileName = 'core.jar'
        }

        task coreWar(type: War) 

        artifacts {
            archives coreJar
            archives coreWar
        }


        sourceSets {
            main {
                java {
                    srcDir 'src'
                    srcDir 'web-app/WEB-INF/classes'
                }
                resources {
                    srcDir 'src'
                    include '*.vm'
                }
            }
            test {
                java {
                    srcDir 'test-src'
                }
            }
        }

        dependencies {
            api 'xerces:xerces:2.4.0'
        }