deathangel908
deathangel908

Reputation: 9709

Idea doesn't upgrade sources while in local debug for appEngine app

I created Spring Boot + Google App Engine application. For development purpose I use IntelliJ IDEA and Google Cloud Tools plugin. I'm currently using only localDebug, which means I don't deploy anything on Google cloud. The configuration for debug is below:

enter image description here

I created a simple service to be sure if my code is updated on change or not:

static int i = 10;
@GetMapping(value = "/test")
public String test() {
    return Integer.toString(++i);
}

Unfortunately when I change my code (e.g. from i = 10 to i = 100) and restart the app (I mean press on Rerun (Ctrl+F5) or Stop (Ctrl+F2) + Run my code doesn't apply on server, which means Idea doesn't rebuild the sources on server start. As you see on the screenshot above I even tried to add Build Project step to Before launch, which didn't work.

Is there anything I can do to force IDEA compile my sources? Is it a bug I should report to plugin developer. Or maybe appengine uses some additional remote sources that require explicit call of maven?

Upvotes: 0

Views: 50

Answers (1)

deathangel908
deathangel908

Reputation: 9709

I finally found a solution. As I understood the Google cloud plugin just complies the classes into target/classes but when it starts the appEngine, the engine expected unpacked .war to be present under target/demo-0.0.1-SNAPSHOT.

E.g. if because if I delete both directories I get the error below:

enter image description here

To solve the issue I needed to compile those sources:

  • In toolbar Run -> Edit configuration
  • Select Google App Engine Standard Local server
  • In before launch add Build Artifact -> demo:war exploded where demo is the name of your App.

enter image description here

Upvotes: 1

Related Questions