Reputation: 9709
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:
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.
mvn appengine:run
-> press Ctrl+C
to stop it, switch to IDEA and start debug again which is a pain in the ass.Hot Reload
(Update application, Ctrl+F10
). It recompiles only changed classes and reloads resources. This is a cool feature, but unfortunately it doesn't work in a lot of cases which makes me unable to use it as a reliable reload.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
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:
To solve the issue I needed to compile those sources:
Run
-> Edit configuration
Google App Engine Standard Local server
Build Artifact
-> demo:war exploded
where demo is the name of your App.Upvotes: 1