Instructions for the Site Verification V1 Command-Line Sample
Register Your Application
- Visit the Google Cloud
- If necessary, sign in to your Google Account, select or create a project,
and agree to the terms of service. Click Continue.
- Select "Installed application" and choose type "Other" under the Installed Application type.
- Within "OAuth 2.0 Client ID", click on "Download JSON". Later on, after you check
out the sample project, you will copy this downloaded file (e.g.
If you skip this step, when trying to run the sample you will get a
INVALID_CLIENT error in the browser.
Prerequisites: install Java 6, Mercurial, and Maven. You may need to
hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
mvn -q exec:java
To enable logging of HTTP requests and responses (highly recommended
when developing), please take a look at logging.properties.
Setup Project in Eclipse
Prerequisites: install Eclipse,
the Mercurial plugin, and the
- Setup Eclipse Preferences
- Window > Preferences... (or on Mac, Eclipse >
- Select Maven
- check on "Download Artifact Sources"
- check on "Download Artifact JavaDoc"
- File > Import...
- Select "General > Existing Project into Workspace" and click
- Click "Browse" next to "Select root directory", find
and click "Next"
- Click "Finish"
- Right-click on project siteVerification-cmdline-sample
- Run As > Java Application
- If asked, type "VerificationSample" and click OK