Nov 3, 2018

How to Specify a port for local testing for Google App Engine Java Development using Apache Maven

When you run your app in the local development server, the default port is 8080. You can change this default by modifying the plugin entry for appengine-maven-plugin (or adding it if it doesn't exist). For example, we specify port and address in the following<plugin> entry within <plugins> inside the main app directory pom.xml file (myapp/pom.xml):

   <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>${appengine.version}</version>
               <configuration>
                   <enableJarClasses>false</enableJarClasses>
                   <version>${app.version}</version>
                   <!-- Comment in the below snippet to bind to all IPs instead of just localhost -->
                   <!-- address>0.0.0.0</address>
                   <port>8888</port -->
                   <!-- Comment in the below snippet to enable local debugging with a remote debugger
                        like those included with Eclipse or IntelliJ -->
                   <!-- jvmFlags>
                     <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
                   </jvmFlags -->
               </configuration>
   </plugin>