I am able to load multiple services with the gradle plugin. This would be great if it weren't for the fact that every service is assigned a random port number every time you run:
gradle appengineRun
You can specify a port in the run section of the build.gradle file but this will only apply to the default port. The other services will have a random port.
This makes it difficult to debug an app locally when one service needs to communicate with another service because you have to change the port in code before you run the app each time.
Maybe there's a way to programmatically retrieve the port number used by each service? I doubt it.
That leads me back to using my original solution which was to not use the gradle plugin for running the app. Instead, just launch multiple instances of the local dev server giving each their own port. I then setup the domain names in my hosts file as follows:
I then use IntelliJ and open each service as a separate project. I can put breakpoints in each service and they will get hit. The advantage of all of this? The urls I use for local testing and production are identical except that I need to append a port to the local url. But this port is fixed and never changes.
Still this solution does require running multiple instances of the local dev server when it probably can be eliminated and a single instance run. But this only works if I use the gradle plugin. How can I get the local dev server to use the exploded war files from multiple services but without using the gradle plugin? The gradle plugin is able to do this, so it must be possible by some other means outside of the plugin.
I am able to load multiple services with the gradle plugin. This would be great if it weren't for the fact that every service is assigned a random port number every time you run:
gradle appengineRun
You can specify a port in the run section of the build.gradle file but this will only apply to the default port. The other services will have a random port.
This makes it difficult to debug an app locally when one service needs to communicate with another service because you have to change the port in code before you run the app each time.
Maybe there's a way to programmatically retrieve the port number used by each service? I doubt it.
That leads me back to using my original solution which was to not use the gradle plugin for running the app. Instead, just launch multiple instances of the local dev server giving each their own port. I then setup the domain names in my hosts file as follows:
I then use IntelliJ and open each service as a separate project. I can put breakpoints in each service and they will get hit. The advantage of all of this? The urls I use for local testing and production are identical except that I need to append a port to the local url. But this port is fixed and never changes.
Still this solution does require running multiple instances of the local dev server when it probably can be eliminated and a single instance run. But this only works if I use the gradle plugin. How can I get the local dev server to use the exploded war files from multiple services but without using the gradle plugin? The gradle plugin is able to do this, so it must be possible by some other means outside of the plugin.