gretty icon indicating copy to clipboard operation
gretty copied to clipboard

Farm specifying different ports for different web apps

Open R4N opened this issue 7 years ago • 0 comments

I currently have this project structure:

Project A: \ Project B \ Project C

I was wondering if it's possible to use farm to specify different ports on which each web app will be run.

i.e. within Project A build.gradle farm block

farm {
  servletContainer 'tomcat8'
  webapp ':ProjectB' // run on port 8080
  webapp ':ProjectC' // run on port 8081
}

I'm currently able to accomplish something similar by running

./gradlew :ProjectB:tomcatRun & ./gradlew :ProjectC:tomcatRun

and specifying the ports for them to run on in their respective build.gradle gretty blocks

i.e. Project B

gretty {
  servletContainer 'tomcat8'
  httpPort = 8080
}

Project C

gretty {
  servletContainer 'tomcat8'
  httpPort = 8081
}

Thanks!

Edit: From looking at this document , it appears it should respect the gretty block of the subprojects which contain the web-app specific properties.

Edit2:

I've created a very small test project (no source just the build.gradle file examples) which displays the issue i'm running into: https://github.com/R4N/testGretty Basically when running ./gradlew farmRun it seems to respect the contextPath set within the gretty block of subprojects, but not the httpPort.

R4N avatar Mar 30 '18 17:03 R4N