Merge branch 'stable-2.15'

* stable-2.15:
  Allow analytics to aggregate by branch

Change-Id: Icac860297cb3c3e534f1f48a4fa76a876d87e751
diff --git a/build.sbt b/build.sbt
index 9082863..00adcc9 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
 enablePlugins(GitVersioning)
 
-val gerritApiVersion = "2.15.3"
+val gerritApiVersion = "2.16-rc1"
 
 val pluginName = "analytics"
 
@@ -9,19 +9,19 @@
 lazy val root = (project in file("."))
   .settings(
     name := pluginName,
-
-    version := "2.14-SNAPSHOT",
+    resolvers += Resolver.mavenLocal,
+    version := "2.16-SNAPSHOT",
 
     scalaVersion := "2.11.8",
 
     libraryDependencies ++= Seq(
-      "io.fabric8" % "gitective-core" % "0.9.37"
+      "io.fabric8" % "gitective-core" % "0.9.54"
         exclude ("org.eclipse.jgit", "org.eclipse.jgit"),
 
       "com.google.inject" % "guice" % "4.2.0" % Provided,
       "com.google.gerrit" % "gerrit-plugin-api" % gerritApiVersion % Provided withSources(),
-      "com.google.code.gson" % "gson" % "2.8.0" % Provided,
-      "joda-time" % "joda-time" % "2.9.9" % Provided,
+      "com.google.code.gson" % "gson" % "2.8.5" % Provided,
+      "joda-time" % "joda-time" % "2.9.9",
 
       "org.scalatest" %% "scalatest" % "3.0.1" % Test,
       "net.codingwell" %% "scala-guice" % "4.1.0" % Test),
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
index 4b6c5e7..34cae77 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/Contributors.scala
@@ -17,7 +17,8 @@
 import com.google.gerrit.extensions.api.projects.CommentLinkInfo
 import com.google.gerrit.extensions.restapi.{BadRequestException, Response, RestReadView}
 import com.google.gerrit.server.git.GitRepositoryManager
-import com.google.gerrit.server.project.{ProjectCache, ProjectResource, ProjectsCollection}
+import com.google.gerrit.server.project.{ProjectCache, ProjectResource}
+import com.google.gerrit.server.restapi.project.ProjectsCollection
 import com.google.gerrit.sshd.{CommandMetaData, SshCommand}
 import com.google.inject.Inject
 import com.googlesource.gerrit.plugins.analytics.common.DateConversions._
diff --git a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/ProjectResourceParser.scala b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/ProjectResourceParser.scala
index 711d5ac..b890dbb 100644
--- a/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/ProjectResourceParser.scala
+++ b/src/main/scala/com/googlesource/gerrit/plugins/analytics/common/ProjectResourceParser.scala
@@ -14,10 +14,8 @@
 
 package com.googlesource.gerrit.plugins.analytics.common
 
-import java.io.IOException
-
-import com.google.gerrit.extensions.restapi.UnprocessableEntityException
-import com.google.gerrit.server.project.{ProjectResource, ProjectsCollection}
+import com.google.gerrit.server.project.ProjectResource
+import com.google.gerrit.server.restapi.project.ProjectsCollection
 import org.kohsuke.args4j.Argument
 
 trait ProjectResourceParser {
diff --git a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GitTestCase.scala b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GitTestCase.scala
index 1449a35..c7a3850 100644
--- a/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GitTestCase.scala
+++ b/src/test/scala/com/googlesource/gerrit/plugins/analytics/test/GitTestCase.scala
@@ -149,7 +149,7 @@
     */
   protected def deleteBranch(repo: File, name: String): String = {
     use(Git.open(repo)) { git =>
-      git.branchDelete().setBranchNames(name).call.get(0)
+      git.branchDelete().setBranchNames(name).setForce(true).call.get(0)
     }
   }