java - Gradle all in one build -


i use gradle build java project , structure follows.

  • core library
  • web app (war plugin)
  • server (application plugin)
  • client
  • client war (war plugin)

the web app, server, , client depend on core. server depends on web app because going serve admin page using embedded jetty. client war depends on client. client war deployed web server distribution of client web start application.

what know how can tell server project depends on web app , needs copy proper location in it's distribution structure. know how can tell client war project depend on client project , copy client jar , of it's dependencies proper location build war archive.

i plan use application plugin server under <root>/src/dist there webapp directory 1 or possibly more web apps reside. expected files contained in webapp directory war files.

this new project can follow standard build conventions of gradle , project layout expected gradle.

ideally @ point client artifacts published internal artifactory or sonatype nexus repository client war can built version support.

so far have found following resources.

i believe figured out web app dependency part of problem. client war lost cause now.

server build.gradle

apply plugin: 'java' apply plugin: 'maven' apply plugin: 'application'  targetcompatibility = 1.8 sourcecompatibility = 1.8 version = '0.0.1-snapshot' group = 'com.s2d' mainclassname = 'com.simonsoftwaredesign.example.echo.server.echoserverapp'  repositories {   mavencentral() }  configurations {   webcontainer }  dependencies {   compile project(':echo-core')   compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.7.v20160115'   compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.3.7.v20160115'    webcontainer project(path: ':echo-admin', configuration: 'warapp') }  task copywebapps(dependson: configurations.webcontainer, type: copy) {   { configurations.webcontainer.collect { } }   // don't how hard coded   // not sure how fix   'src/main/dist/webapp' }  installdist.dependson copywebapps distzip.dependson copywebapps disttar.dependson copywebapps 

web app build.gradle

apply plugin: 'java' apply plugin: 'maven' apply plugin: 'war'  targetcompatibility = 1.8 sourcecompatibility = 1.8 version = '0.0.1-snapshot' group = 'com.s2d'  configurations {   warapp }  repositories {   mavencentral() }  dependencies {   providedcompile project(':echo-core')   providedcompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' }  artifacts {   warapp war } 

gradle projects depending on artifacts created sibling projects


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -