Sunday, November 16, 2025

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

> 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.

On Thursday, 16 October 2025 at 11:25:26 am UTC+11 Craig Mitchell wrote:
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.

On Thursday, 16 October 2025 at 11:16:07 am UTC+11 Craig Mitchell wrote:
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.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/ddd6dcc3-f35c-4577-91d9-6bef1375dd0dn%40googlegroups.com.

No comments:

Post a Comment