Gae maven how to deploy

I am very new to GAE / Java / Maven and, based on the .net background, ready to try.

I installed the Google App Engine plugin for eclipse 4.2. I created the application using the Google plugin, and everything went according to plan. It works beautifully. I can develop, test on a local server and deploy to the cloud without any problems.

The problem arises when I want to use Maven too. Then you need to create the "Mavern" project based on some archetype. I followed the tutorial at https://developers.google.com/appengine/docs/java/tools/maven and started building the guestbook application.

Everyone went according to plan. I can start the dev server from the command line and test the application in the browser. The only problem is where the tutorial ends.

I do not know how to deploy this to Google Cloud from the command line. You can no longer use the Google plugin, as it simply does not recognize the application as an AppEngine application.

Can someone please help me here? Thanks

+6
source share
4 answers
+4
source

Use mvn appengine:update .

https://cloud.google.com/appengine/docs/java/tools/maven#uploading_your_app_to_production_app_engine

To download an application created using appengine-skeleton-archetype:

  • Change the directory to the top level of your project (e.g. myapp) and call Maven as follows:

     mvn appengine:update 
  • You will be prompted to enter the authorization code in the terminal window and your web browser will be launched with the consent that you must accept for authorization. Follow suggests copying all the codes from the browser to the command line.

Please note that # 2 only happens on first deployment.

+2
source

I tried to follow the document and use maven to download new code, the command runs without errors and can run locally, but this does not affect the application in the Google cloud. I went to the project toolbar, I found that in the versions of the tabs there is one instance, including a new one. On this tab, I found that I was mistaken with the version of the application, in my case I have 3 versions. I transfer the traffic to the last one and everything works fine.

0
source

The best way is to use Maven Goals from the command line. From the Google Documentation for Deploying a Java Application :

If you are using the Maven plugin based on the SDK for App Engine, use the command:

 mvn appengine:update 

If you are using the Cloud SDK-based Maven plugin, use the command:

 mvn appengine:deploy 

The Cloud SDK-based plugin is more relevant, and ideally you should use it (which means using mvn appengine:deploy ).

Documentation for mvn appengine: deploy

0
source

Source: https://habr.com/ru/post/946806/


All Articles