Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 20352

Ear file depends on EJB & WAR from subproject

$
0
0

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'
}

Viewing all articles
Browse latest Browse all 20352

Trending Articles