Code Server fixed for Windows Users (now shuts down correctly)

61 views
Skip to first unread message

Craig Mitchell

unread,
Oct 15, 2025, 8:16:07 PMOct 15
to GWT Users
Thomas fixed the code server for Windows users: https://github.com/tbroyer/gwt-maven-plugin/issues/110#issuecomment-3405235827

Thanks Thomas!

Thought I'd clean up my IntelliJ dev startup.  What I figured out is:
  1. Create a maven launcher for the codeserver.
  2. Create a maven launcher for your server.
  3. And you can create maven launches for thinks like your DB.
  4. Then create a compound launcher to start everything with one click.  IntelliJ also gives you a "Stop All" button to stop everything with one click.
Much easier!

To create a maven launcher for your DB, you use "exec-maven-plugin".  For example, I'm using Google App Engine, so I added this to my pom.xml:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>${exec-maven-plugin.version}</version>
  <executions>
    <execution>
      <id>start-datastore-emulator</id>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>gcloud</executable>
        <arguments>
           <argument>beta</argument>
            <argument>emulators</argument>
            <argument>datastore</argument>
            <argument>start</argument>
            <argument>--use-firestore-in-datastore-mode</argument>
            <argument>--data-dir=local_db</argument>
          </arguments>
       </configuration>
     </execution>
  </executions>
</plugin>

Now I just create a maven launcher in IntelliJ "exec:exec@start-datastore-emulator" and it'll start my local DB.

If anyone has any tips for improving it, please let me know.

Craig Mitchell

unread,
Oct 15, 2025, 8:25:26 PMOct 15
to GWT Users
Forgot to say, the reason for starting everything via a maven launcher, is so IntelliJ knows it's running, and the "Stop All" button works.

If you run things as an external tool, or shell script, IntelliJ doesn't know how to stop it.

Craig Mitchell

unread,
Nov 16, 2025, 7:54:13 PMNov 16
to GWT Users
> Then create a compound launcher to start everything with one click.

This is a bad idea, as the code server needs to start first (I was sometimes getting com.google.gwt.user.client.rpc.SerializationException errors, as the codeserver hadn't finished creating the client code before the server launched).

I haven't come up with a great solution to launching everything at once.  The best I've done is just put a delay in the servers pom.xml:

<!-- Wait 10 seconds before starting Spring Boot, so the GWT Code Server starts up first -->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-antrun-plugin</artifactId>
  <version>3.1.0</version>
  <executions>
    <execution>
      <id>sleep-before-springboot</id>
      <phase>initialize</phase>
      <configuration>
        <target>
          <sleep seconds="10" />
          <echo message="Waited 10 seconds before starting Spring Boot"/>
        </target>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>

I looked at creating a script, but using a script means IntelliJ doesn't know it's running, and its "Stop All" button doesn't work.
Reply all
Reply to author
Forward
0 new messages