BUCK: deploy plugin api to local and remote maven repos

`buck build api_install` copies the artifacts to the local maven repository.

`buck build api_deploy` uploads the artifacts to the remote maven repository.
The type of the repo is induced from the Gerrit version name, i. e.
* 2.8-SNAPSHOT: snapshot repo
* 2.8: release repo

Change-Id: I063834bb39311a4d92f5fdbb183f70b1fb8418b6
diff --git a/BUCK b/BUCK
index ee5ba75..98a85a1 100644
--- a/BUCK
+++ b/BUCK
@@ -6,19 +6,24 @@
 gerrit_war(name = 'withdocs', context = DOCS)
 gerrit_war(name = 'release',  context = DOCS + ['//plugins:core.zip'])
 
+API_DEPS = [
+  ':extension-api',
+  ':extension-api-src',
+  ':plugin-api',
+  ':plugin-api-src',
+]
+
 genrule(
   name = 'api',
   cmd = '',
   srcs = [],
-  deps = [
-    ':extension-api',
-    ':extension-api-src',
-    ':plugin-api',
-    ':plugin-api-src',
-  ],
+  deps = API_DEPS,
   out = '__fake.api__',
 )
 
+maven_install(deps = API_DEPS)
+maven_deploy(deps = API_DEPS)
+
 java_binary(name = 'extension-api', deps = [':extension-lib'])
 java_library(
   name = 'extension-lib',