Gradle ear plugin - Compile source to specified output folder

I have project with below structure

--MyPrj.ear
  --APP-INF
    --src
    --lib
  --META-INF
    --application.xml
    --weblogic-application.xml
  --WEB_MAIN
    --assets
    --WEB-INF
      --conf
      --web.xml
      --weblogic.xml

I want to deploy to PRJ.ear file with below structure:

--MyPrj.ear
  --APP-INF
    --classes
    --lib
  --META-INF
    --application.xml
    --weblogic-application.xml
  --WEB_MAIN
    --assets
    --WEB-INF
      --conf
      --web.xml
      --weblogic.xml

And here is my ear configuration:

ear {
    baseName 'PRJ'
    appDirName 'APP-INF/src'
    libDirName 'APP-INF/lib'

    ear{
        into("META-INF"){
            from("META-INF") {
                exclude 'application.xml'
            }
        }
        into("WEB_MAIN") {
            from ("WEB_MAIN")
        }
    }

    deploymentDescriptor {
        webModule 'WEB_MAIN', '/'
        applicationName = "PRJ"
    }
}

My actual result:

--MyPrj.ear
  --APP-INF
    --lib
  --com
  --META-INF
    --application.xml
    --weblogic-application.xml
  --WEB_MAIN
    --assets
    --WEB-INF
      --conf
      --web.xml
      --weblogic.xml

Cannot generate APP-INF/classes

did you ever figure out how to accomplish this?