Selecting specific ports on the local development server for non-default modules
In my build.gradle file, I am using the following configuration for my non-default AppEngine gradle module (module2):
appengine {
downloadSdk = true
httpAddress = "0.0.0.0"
httpPort = 8081
appcfg {
email = "blahemail@domain.com"
oauth2 = true
}
}
However, when I run my "Google AppEngine config" the module still runs on some_random_port instead of 8081. I want to fix the ports they run so I can rely on those ports when I run test requests to my local development server.
What am I doing wrong? Or is it just not supported?
=============================================== === ===================== Appengine module structure:
- root( apply java, ear, appengine)
- default (apply java, war, appengine) - needs to run on 8080 on local dev server
- module2 (apply java, war, appengine) - needs to run on 8081 on local dev server
App version: 1.9.22
Gradle Appengine plugin version: 1.9.21
EDIT
I have also tried to run each module in its own Appengine run configuration, and while the modules are running on their respective ports, I can no longer communicate between them. Attempting to schedule a task on module2 from a servlet modulo by default gives the following error:
com.google.appengine.api.modules.ModulesException: Unknown module
at com.google.appengine.api.modules.ModulesServiceImpl$ModulesServiceFutureWrapper.convertApplicationException(ModulesServiceImpl.java:365)
at com.google.appengine.api.modules.ModulesServiceImpl$ModulesServiceFutureWrapper.convertException(ModulesServiceImpl.java:352)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:96)
at com.google.appengine.api.modules.ModulesServiceImpl.getAsyncResult(ModulesServiceImpl.java:104)
at com.google.appengine.api.modules.ModulesServiceImpl.getDefaultVersion(ModulesServiceImpl.java:163)
source to share
@crazystick answered this for Maven. Here, too, the solution was re-executed for Gradle:
apply plugin: ear
...
appengine {
downloadSdk = true
httpAddress = "0.0.0.0"
jvmFlags = ['-Dcom.google.appengine.devappserver_module.default.port=8080',
'-Dcom.google.appengine.devappserver_module.module1.port=8081']
appcfg {
email = "blahemail@domain.com"
oauth2 = true
}
}
source to share