diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml
index 1ab0203cf290..284db593f0dc 100644
--- a/hbase-assembly/pom.xml
+++ b/hbase-assembly/pom.xml
@@ -142,6 +142,20 @@
**\/NOTICE,**\/NOTICE.txt
+
+
+ prepare-shaded-client-repo
+ package
+
+ copy-dependencies
+
+
+ hbase-shaded-client,hbase-shaded-client-byo-hadoop,hbase-shaded-mapreduce,hbase-shaded-testing-util
+ ${project.build.directory}/maven-repo
+ true
+ true
+
+
diff --git a/hbase-assembly/src/main/assembly/components.xml b/hbase-assembly/src/main/assembly/components.xml
index 346cc8ce8ada..f12adabe8e05 100644
--- a/hbase-assembly/src/main/assembly/components.xml
+++ b/hbase-assembly/src/main/assembly/components.xml
@@ -168,5 +168,11 @@
0644
+
+ ${project.build.directory}/maven-repo
+ hbase-webapps/maven-repo
+ 0644
+ 0755
+
diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
index fb9870032c22..1f38374b0137 100644
--- a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
+++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
@@ -728,6 +728,7 @@ protected void addDefaultServlets(
LOG.info("ASYNC_PROFILER_HOME environment variable and async.profiler.home system property " +
"not specified. Disabling /prof endpoint.");
}
+ addUnprivilegedServlet("version", "/version", VersionServlet.class);
}
/**
diff --git a/hbase-http/src/main/java/org/apache/hadoop/hbase/http/VersionServlet.java b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/VersionServlet.java
new file mode 100644
index 000000000000..7fe73e45b150
--- /dev/null
+++ b/hbase-http/src/main/java/org/apache/hadoop/hbase/http/VersionServlet.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.http;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.hadoop.hbase.util.VersionInfo;
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Servlet which returns the HBase version.
+ */
+@InterfaceAudience.Private
+public class VersionServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ response.setContentType("text/plain");
+ response.getWriter().append(VersionInfo.getVersion());
+ }
+}