From your usage of the Goal appengine:run
I understand that you are testing your application with the Local Development Server. By having a look at the documentation for appengine:run
, you can use the flag port to launch two independent instances of the Development Server in different ports.
You can define that flag by using a command like:
mvn appengine:run -Dapp.devserver.port=<PORT_NUMBER>
The default port number in the Development Server is 8080, so you can, for example, use port 8080 for your Module1 and then use a different port, such as 8082 for your Module2. That way, you can move to the directories where your two services are located, and run those two commands with different port numbers, and then you will be able to access them in localhost:8080
and localhost:8082
, respectively.
Update (possibly a better solution)
Actually, as stated in the documentation:
If the root directory of your project contains only your services, you
can deploy all those services with a single Maven command.
This works both for a deployment in the production environment (App Engine) and also in the Development Server. So if you configure your application appropriately, you can launch both services in the same development server instance (they will still launch in different ports) using a single mvn appengine:run
command.
So in order to configure a Java GAE application with all its services, you can follow the same idea presented in this (unrelated to this topic) migration guide. To do so, when you configure the com.google.cloud.tools » appengine-maven-plugin in the pom.xml
file in your default service, you have to add the <services>
tag, including all the services in your application, starting by the default service:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<deploy.project>PROJECT_NAME</deploy.project>
<deploy.version>PROJECT_VERSION</deploy.version>
<services>
<!-- Default service -->
<service>
${project.build.directory}/${project.name}-${project.version}
</service>
<!-- One for each additional service -->
<service>
${project.parent.basedir}/SERVICE_NAME/target/SERVICE_ARTIFACT-${project.version}
</service>
</services>
</configuration>
</plugin>
Once this is complete, your application will detect all the services associated to it, and you will be able to work with all of them simultaneously with a single Maven command, i.e. mvn appengine:deploy
will deploy all services and mvn appengine:run
will start a Development Server with all services in it. For the case of the Development Server, you can visit the Server Admin in localhost:PORT/_ah/admin
, and then move to the Modules tab to find the URLs for each of the running services:

I hope one of these two alternatives (although I would go for the second) are useful for your use case.