Experimental fix for gerrit-owners to build vs gerrit's HEAD

current gerrit's head is 7a05f9f
diff --git a/common.defs b/common.defs
index 17f4c86..a717515 100644
--- a/common.defs
+++ b/common.defs
@@ -1,44 +1,14 @@
 include_defs('//lib/maven.defs')
 include_defs('//lib/prolog/prolog.defs')
 
-JACKSON_REV = '2.1.1'
-maven_jar(
-  name = 'jackson-core',
-  id = 'com.fasterxml.jackson.core:jackson-core:%s' % JACKSON_REV,
-  license = 'Apache2.0',
-)
-
-maven_jar(
-  name = 'jackson-databind',
-  id = 'com.fasterxml.jackson.core:jackson-databind:%s' % JACKSON_REV,
-  license = 'Apache2.0',
-)
-
-maven_jar(
-  name = 'jackson-annotations',
-  id = 'com.fasterxml.jackson.core:jackson-annotations:%s' % JACKSON_REV,
-  license = 'Apache2.0',
-)
-
-maven_jar(
-  name = 'jackson-dataformat-yaml',
-  id = 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:%s' % JACKSON_REV,
-  license = 'Apache2.0',
-)
-
-maven_jar(
-  name = 'gitective-core',
-  id = 'org.gitective:gitective-core:0.9.9',
-  license = 'Apache2.0',
-)
-
 EXTERNAL_DEPS = [
-  ':gitective-core',
-  ':jackson-core',
-  ':jackson-databind',
-  ':jackson-annotations',
-  ':jackson-dataformat-yaml',
-]
+  '//plugins/gerrit-owners/gerrit-owners-common' + i for i in [
+    ':gitective-core',
+    ':jackson-core',
+    ':jackson-databind',
+    ':jackson-annotations',
+    ':jackson-dataformat-yaml',
+  ]]
 
 # These are dependencies that must be made available to the plugins' libraries at compilation
 # time, but should not be included in the plugins' jar files since they will be provided
@@ -46,6 +16,15 @@
 # For this reason all the intermediate java libraries that we build are java_library2 targets
 # rather than java_library.
 COMPILE_DEPS = [
-  '//:plugin-lib',
+  '//lib:guava',
+  '//lib/guice:guice',
+  '//lib:gwtorm',
+  '//lib/jgit:jgit',
+  '//lib/log:api',
+  '//gerrit-plugin-api:plugin-api',
+  '//gerrit-reviewdb:client',
+  '//gerrit-reviewdb:server',
+  '//gerrit-server:server',
+  '//gerrit-extension-api:lib',
   '//lib/prolog:prolog-cafe',
 ]
diff --git a/gerrit-owners-autoassign/BUCK b/gerrit-owners-autoassign/BUCK
index 18d0393..2678ed9 100644
--- a/gerrit-owners-autoassign/BUCK
+++ b/gerrit-owners-autoassign/BUCK
@@ -1,4 +1,6 @@
 include_defs('//plugins/gerrit-owners/common.defs')
+include_defs('//lib/maven.defs')
+include_defs('//lib/prolog/prolog.defs')
 
 gerrit_plugin(
   name = 'owners-autoassign',
diff --git a/gerrit-owners-common/BUCK b/gerrit-owners-common/BUCK
index ea5fb6a..61f5e60 100644
--- a/gerrit-owners-common/BUCK
+++ b/gerrit-owners-common/BUCK
@@ -1,14 +1,44 @@
 include_defs('//plugins/gerrit-owners/common.defs')
+include_defs('//lib/maven.defs')
+include_defs('//lib/prolog/prolog.defs')
+
+JACKSON_REV = '2.1.1'
+maven_jar(
+  name = 'jackson-core',
+  id = 'com.fasterxml.jackson.core:jackson-core:%s' % JACKSON_REV,
+  license = 'Apache2.0',
+)
+
+maven_jar(
+  name = 'jackson-databind',
+  id = 'com.fasterxml.jackson.core:jackson-databind:%s' % JACKSON_REV,
+  license = 'Apache2.0',
+)
+
+maven_jar(
+  name = 'jackson-annotations',
+  id = 'com.fasterxml.jackson.core:jackson-annotations:%s' % JACKSON_REV,
+  license = 'Apache2.0',
+)
+
+maven_jar(
+  name = 'jackson-dataformat-yaml',
+  id = 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:%s' % JACKSON_REV,
+  license = 'Apache2.0',
+)
+
+maven_jar(
+  name = 'gitective-core',
+  id = 'org.gitective:gitective-core:0.9.9',
+  license = 'Apache2.0',
+)
 
 # see common.defs on why this is a java_library2 rather than java_library
-java_library2(
+java_library(
   name = 'common',
   srcs = glob([
     'src/main/java/**/*.java',
   ]),
-  deps = [],
-  # Notice that we put EXTERNAL_DEPS as compile_deps to prevent double inclusion in the owners
-  # plugin.
-  compile_deps = COMPILE_DEPS + EXTERNAL_DEPS,
+  deps = COMPILE_DEPS + EXTERNAL_DEPS,
   visibility = ['PUBLIC'],
 )
diff --git a/gerrit-owners/BUCK b/gerrit-owners/BUCK
index 0ef0040..c425c65 100644
--- a/gerrit-owners/BUCK
+++ b/gerrit-owners/BUCK
@@ -1,21 +1,20 @@
 include_defs('//plugins/gerrit-owners/common.defs')
+include_defs('//lib/maven.defs')
+include_defs('//lib/prolog/prolog.defs')
 
 # buck is unhappy to build a gerrit_plugin with no source files.
 # On the other side, gerrit-owners-prolog-rules needs to be built after all the java files have been
 # compiled. For this reason we have a stub class that has no content and just makes buck happy.
 COMPILE_STUB = ['src/main/java/com/vmware/gerrit/owners/CompileStub.java']
 
-java_library2(
+java_library(
   name = 'gerrit-owners-lib',
   srcs = glob([
     'src/main/java/**/*.java',
   ], excludes=COMPILE_STUB),
   deps = [
     '//plugins/gerrit-owners/gerrit-owners-common:common',
-  ],
-  # Notice that we put EXTERNAL_DEPS as compile_deps to prevent double inclusion in the owners
-  # plugin.
-  compile_deps = COMPILE_DEPS + EXTERNAL_DEPS,
+  ] + COMPILE_DEPS + EXTERNAL_DEPS,
 )
 
 prolog_cafe_library(