user1980175
user1980175

Reputation:

GAE Maven how to deploy

I'm very new to GAE/Java/Maven and coming from a .net background, is eager to try it out.

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

Problem comes in when I would like to use Maven as well - Then you need to create a 'Mavern project' based on some archetype. I've followed the tutorial at: https://developers.google.com/appengine/docs/java/tools/maven, and started to create the 'guestbook' application.

All went according to plan. I can run the dev server from the command line and test the application in a browser. Only problem is - this is where the tutorial ends.

I have no idea how to deploy this to the Google Cloud from the command line. You can't use the Google plugin anymore either since it just doesn't recognize the application as an 'AppEngine' app.

Can someone please help me out here? Thanks

Upvotes: 6

Views: 5496

Answers (4)

Chris Halcrow
Chris Halcrow

Reputation: 31990

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

If you are using the App Engine SDK-based Maven plugin, 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 current and you should ideally be using it (which means using mvn appengine:deploy).

Documentation for mvn appengine:deploy

Upvotes: 1

Vu Hoang Son
Vu Hoang Son

Reputation: 41

I tried to follow the document and use maven for upload new code, the command run without error and can run at local but it does not affect the app on google cloud. I went to dashboard of the project, I found under tab versions there are some instance include the new one. At this tab I found I made a mistake with app version, in my case I have 3 version. I migrate traffic to the lasted one, and everything work fine.

Upvotes: 0

CupawnTae
CupawnTae

Reputation: 14600

Use mvn appengine:update.

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

To upload an app created with the the appengine-skeleton-archetype:

  1. Change directory to the top level of your project (for example, myapp) and invoke Maven as follows:

    mvn appengine:update
    
  2. You will be prompted for an authorization code in the terminal window and your web browser will launch with a consent screen which you must accept in order to be authorized. Follow the prompts to copy any codes from the browser to the command line.

Note that #2 only happens on first deployment.

Upvotes: 3

user1980175
user1980175

Reputation:

Maybe its time to go to bed...

https://developers.google.com/appengine/docs/java/tools/uploadinganapp

Upvotes: 4

Related Questions