Gradle - build ear containing wars from repositories

385 views Asked by At

I have a gradle project that builds war that it's then being published to artifactory. So now I have a project that need to take war(s) and put it into ear. The only way that I have found to get it to work is by specifying a path or a project name where artifact is being built.

How to build it by specifying a dependency so the war can be downloaded from a repository?

Any help appreciated.

1

There are 1 answers

0
karruma On BEST ANSWER

I was able to achieve that - by doing this:

dependencies{

earlib(     
    [group: 'com.company', name: 'webapp1', version: '1.1-SNAPSHOT', ext: 'war'],   
    [group: 'com.company', name: 'webapp2', version: '1.1-SNAPSHOT', ext: 'war'])

}

ear {
baseName = ' bundle'
extension = 'ear'       


deploymentDescriptor{
    webModule( 'lib/webapp1-1.1-SNAPSHOT.war', '/webapp1' )
    webModule( 'lib/webapp2-1.1-SNAPSHOT.war', '/webapp2' ) 
}

}