This is an automated email from the ASF dual-hosted git repository.

deniskuzZ pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 04ad966e411 HIVE-29869: hive-beeline standalone size reduction (#6748)
04ad966e411 is described below

commit 04ad966e4115ded8b9581ca2b1ba093d408fbdec
Author: illiabarbashov-sketch <[email protected]>
AuthorDate: Mon Oct 12 14:45:20 2026 +0200

    HIVE-29869: hive-beeline standalone size reduction (#6748)
---
 .github/workflows/beeline-release.yml              |  97 ---------
 beeline/pom.xml                                    | 218 +++++--------------
 beeline/src/main/jpackage/windows/main.wxs         | 232 ---------------------
 .../tools}/schematool/TestSchemaTool.java          |   3 +-
 .../apache/hive/beeline/cli/HiveCliForTest.java    |   0
 .../org/apache/hive/beeline/cli/TestHiveCli.java   |   5 +
 packaging/pom.xml                                  |   1 +
 packaging/src/main/assembly/beeline.xml            |   9 -
 standalone-metastore/metastore-server/pom.xml      |   9 +-
 .../metastore-tools/tools-common/pom.xml           |  53 +++++
 .../hive/metastore/IMetaStoreSchemaInfo.java       |   0
 .../hadoop/hive/metastore/MetaStoreSchemaInfo.java |   0
 .../hive/metastore/MetaStoreSchemaInfoFactory.java |   0
 .../tools/schematool/HiveSchemaHelper.java         |   0
 .../tools/schematool/MetastoreSchemaTool.java      |   0
 .../tools/schematool/SchemaToolCommandLine.java    |   0
 .../metastore/tools/schematool/SchemaToolTask.java |   0
 .../schematool/SchemaToolTaskAlterCatalog.java     |   0
 .../schematool/SchemaToolTaskCreateCatalog.java    |   0
 .../schematool/SchemaToolTaskCreateLogsTable.java  |   0
 .../tools/schematool/SchemaToolTaskCreateUser.java |   0
 .../tools/schematool/SchemaToolTaskDrop.java       |   0
 .../tools/schematool/SchemaToolTaskInfo.java       |   0
 .../tools/schematool/SchemaToolTaskInit.java       |   0
 .../schematool/SchemaToolTaskInitOrUpgrade.java    |   0
 .../schematool/SchemaToolTaskMergeCatalog.java     |   0
 .../schematool/SchemaToolTaskMoveDatabase.java     |   0
 .../tools/schematool/SchemaToolTaskMoveTable.java  |   0
 .../tools/schematool/SchemaToolTaskUpgrade.java    |   0
 .../tools/schematool/SchemaToolTaskValidate.java   |   0
 .../hive/metastore/TestMetaStoreSchemaFactory.java |   6 +-
 .../hive/metastore/TestMetaStoreSchemaInfo.java    |   3 -
 .../tools/schematool/TestMetastoreSchemaTool.java  |   3 -
 .../tools/schematool/TestSchemaToolTaskDrop.java   |   0
 standalone-metastore/pom.xml                       |  12 ++
 35 files changed, 131 insertions(+), 520 deletions(-)

diff --git a/.github/workflows/beeline-release.yml 
b/.github/workflows/beeline-release.yml
deleted file mode 100644
index fcd207f3c97..00000000000
--- a/.github/workflows/beeline-release.yml
+++ /dev/null
@@ -1,97 +0,0 @@
-# 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.
-
-name: Beeline Native Installer Release
-
-on:
-  workflow_dispatch:
-    inputs:
-      release_tag:
-        description: 'GitHub release tag to upload artifacts to. Leave empty 
to skip release upload.'
-        required: false
-        default: ''
-        type: string
-
-permissions:
-  contents: write
-
-jobs:
-  build:
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - os: macos-13
-            label: macos-x64
-            artifact_glob: beeline/target/apache-hive-beeline-*/x64/*.dmg
-          - os: macos-latest
-            label: macos-arm64
-            artifact_glob: beeline/target/apache-hive-beeline-*/arm64/*.dmg
-          - os: ubuntu-latest
-            label: linux-x64
-            artifact_glob: beeline/target/apache-hive-beeline-*/x64/*.deb
-          - os: windows-latest
-            label: windows-x64
-            artifact_glob: beeline/target/apache-hive-beeline-*/x64/*.msi
-
-    runs-on: ${{ matrix.os }}
-    # Bounds total job time (queue + execution). Notably guards against 
macos-13
-    # runner-pool starvation as GitHub drains its capacity ahead of 
deprecation.
-    timeout-minutes: 60
-    steps:
-      - uses: actions/checkout@v3
-
-      - name: Set up JDK 21
-        uses: actions/setup-java@v5
-        with:
-          java-version: '21'
-          distribution: temurin
-          cache: maven
-
-      - name: Disable WSL bash stub so Git Bash wins (Windows only)
-        if: runner.os == 'Windows'
-        shell: pwsh
-        run: |
-          $stub = "C:\Windows\System32\bash.exe"
-          if (Test-Path $stub) {
-            Write-Host "Taking ownership of $stub"
-            takeown.exe /F $stub /A | Out-Null
-            icacls.exe $stub /grant "*S-1-5-32-544:F" | Out-Null   # 
Administrators group SID
-            Rename-Item -Path $stub -NewName "bash.exe.disabled" -Force
-          }
-          "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH 
-Encoding utf8 -Append
-          Write-Host "bash now resolves to:"
-          where.exe bash
-          bash --version
-
-      - name: Build Beeline installer
-        run: mvn package -pl beeline -am -DskipTests -P dist
-
-      - name: Upload installer artifact
-        uses: actions/upload-artifact@v4
-        with:
-          name: beeline-${{ matrix.label }}
-          path: ${{ matrix.artifact_glob }}
-          if-no-files-found: error
-
-      - name: Upload installer to GitHub release
-        if: ${{ inputs.release_tag != '' }}
-        uses: softprops/action-gh-release@v2
-        with:
-          tag_name: ${{ inputs.release_tag }}
-          files: ${{ matrix.artifact_glob }}
-          allow_updates: true
-          fail_on_unmatched_files: true
diff --git a/beeline/pom.xml b/beeline/pom.xml
index fbd33678090..a93c0c6dc45 100644
--- a/beeline/pom.xml
+++ b/beeline/pom.xml
@@ -29,7 +29,6 @@
   <name>Hive Beeline</name>
   <properties>
     <hive.path.to.root>..</hive.path.to.root>
-    <jpackage.plugin.version>4.3.0</jpackage.plugin.version>
   </properties>
   <dependencies>
     <!-- dependencies are always listed in sorted order by groupId, artifactId 
-->
@@ -39,11 +38,6 @@
       <artifactId>hive-common</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-metastore</artifactId>
-      <version>${project.version}</version>
-    </dependency>
     <dependency>
       <groupId>org.apache.hive</groupId>
       <artifactId>hive-shims</artifactId>
@@ -53,6 +47,10 @@
           <groupId>log4j</groupId>
           <artifactId>log4j</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>com.microsoft.sqlserver</groupId>
+          <artifactId>mssql-jdbc</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -66,11 +64,6 @@
         </exclusion>
       </exclusions>
     </dependency>
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-standalone-metastore-server</artifactId>
-      <version>${standalone-metastore.version}</version>
-    </dependency>
     <dependency>
       <!--
         Since the compile-time hive-jdbc dependency contains Utils.java,
@@ -87,6 +80,11 @@
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.apache.hive</groupId>
+      <artifactId>metastore-tools-common</artifactId>
+      <version>${standalone-metastore.version}</version>
+    </dependency>
     <!-- inter-project -->
     <dependency>
       <groupId>commons-cli</groupId>
@@ -133,75 +131,56 @@
           <groupId>log4j</groupId>
           <artifactId>log4j</artifactId>
         </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.thrift</groupId>
-      <artifactId>libthrift</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.supercsv</groupId>
-      <artifactId>super-csv</artifactId>
-      <version>${super-csv.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-slf4j-impl</artifactId>
-    </dependency>
-    <!-- test intra-project -->
-    <!--
-    hive-exec, hive-llap-server, and hive-hplsql are declared test scope here 
so that
-    are all needed to run BeelineCli test to manage the embedded HS2 session.
-  -->
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-exec</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-      <exclusions>
+        <!-- kerby/kerberos auth chain pulled in transitively via hadoop-auth; 
beeline
+             does not exercise hadoop-common's Kerberos/UGI code paths -->
         <exclusion>
-          <groupId>*</groupId>
+          <groupId>org.apache.kerby</groupId>
           <artifactId>*</artifactId>
         </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-exec</artifactId>
-      <version>${project.version}</version>
-      <classifier>tests</classifier>
-      <scope>test</scope>
-      <exclusions>
+        <!-- avro is only used by hadoop-common's optional 
SequenceFile/serialization
+             helpers, not by Configuration/FileSystem/Path/IOUtils/ExitUtil -->
         <exclusion>
-          <groupId>log4j</groupId>
-          <artifactId>log4j</artifactId>
+          <groupId>org.apache.avro</groupId>
+          <artifactId>avro</artifactId>
         </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-llap-server</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-      <exclusions>
+        <!-- ZooKeeper client (curator) is unused; beeline does not talk to ZK
+             through hadoop-common -->
         <exclusion>
-          <groupId>*</groupId>
+          <groupId>org.apache.curator</groupId>
           <artifactId>*</artifactId>
         </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.hive</groupId>
-      <artifactId>hive-hplsql</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-      <exclusions>
+        <!-- htrace tracing hooks; not exercised by beeline's thin usage -->
         <exclusion>
-          <groupId>*</groupId>
-          <artifactId>*</artifactId>
+          <groupId>org.apache.htrace</groupId>
+          <artifactId>htrace-core4</artifactId>
+        </exclusion>
+        <!-- jsch (SFTP/SSH) backs hadoop-common's SFTPFileSystem, which 
beeline
+             never instantiates -->
+        <exclusion>
+          <groupId>com.jcraft</groupId>
+          <artifactId>jsch</artifactId>
+        </exclusion>
+        <!-- commons-net (FTP client) backs hadoop-common's FTPFileSystem, 
unused -->
+        <exclusion>
+          <groupId>commons-net</groupId>
+          <artifactId>commons-net</artifactId>
+        </exclusion>
+        <!-- re2j is only used by hadoop-common's optional regex path matching 
-->
+        <exclusion>
+          <groupId>com.google.re2j</groupId>
+          <artifactId>re2j</artifactId>
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>net.sf.supercsv</groupId>
+      <artifactId>super-csv</artifactId>
+      <version>${super-csv.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
     <!-- test inter-project -->
     <dependency>
       <groupId>org.apache.hadoop</groupId>
@@ -231,8 +210,8 @@
     </dependency>
     <dependency>
       <groupId>org.mockito</groupId>
-      <artifactId>mockito-inline</artifactId>
-      <version>${mockito-inline.version}</version>
+      <artifactId>mockito-core</artifactId>
+      <version>${mockito-core.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -243,104 +222,10 @@
     <dependency>
       <groupId>org.postgresql</groupId>
       <artifactId>postgresql</artifactId>
-      <optional>true</optional>
+      <scope>test</scope>
     </dependency>
   </dependencies>
   <profiles>
-    <!--
-    Build a native installer (dmg on macOS, exe/msi on Windows, deb/rpm on 
Linux).
-    Usage:
-      mvn package -pl beeline -am -DskipTests -P dist
-    -->
-    <profile>
-      <id>dist</id>
-      <properties>
-        
<installer.app.version>${jpackage.plugin.version}</installer.app.version>
-        <installer.arch>x64</installer.arch>
-      </properties>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-antrun-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>jpackage</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>run</goal>
-                </goals>
-                <configuration>
-                  <target>
-                    <property name="jpackage.platform.args" value=""/>
-                    <mkdir 
dir="${project.build.directory}/apache-hive-beeline-${project.version}/${installer.arch}"/>
-                    <exec executable="jpackage" failonerror="true">
-                      <!-- Application identity -->
-                      <arg value="--name"/>
-                      <arg value="beeline"/>
-                      <arg value="--app-version"/>
-                      <arg value="${installer.app.version}"/>
-                      <arg value="--vendor"/>
-                      <arg value="Apache Software Foundation"/>
-                      <arg value="--description"/>
-                      <arg value="Apache Hive Beeline SQL client"/>
-                      <!-- Input: the self-contained fat jar -->
-                      <arg value="--input"/>
-                      <arg value="${project.build.directory}"/>
-                      <arg value="--main-jar"/>
-                      <arg value="beeline-standalone.jar"/>
-                      <arg value="--main-class"/>
-                      <arg value="org.apache.hive.beeline.BeeLine"/>
-                      <!-- Output: arch-specific subdirectory so x64 and arm64 
coexist -->
-                      <arg value="--dest"/>
-                      <arg 
value="${project.build.directory}/apache-hive-beeline-${project.version}/${installer.arch}"/>
-                      <arg line="${jpackage.platform.args}"/>
-                      <!--
-                        jpackage picks the native format automatically:
-                          macOS   → dmg  (x64 on Intel, arm64 on Apple Silicon)
-                          Windows → exe
-                          Linux   → deb
-                        To force a specific type, add:
-                          <arg value="- -type"/> <arg value="pkg"/>
-                      -->
-                    </exec>
-                  </target>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <!--
-      Auto-detects Apple Silicon and sets installer.arch=arm64.
-    -->
-    <profile>
-      <id>macos-arm64-installer</id>
-      <activation>
-        <os>
-          <name>Mac OS X</name>
-          <arch>aarch64</arch>
-        </os>
-      </activation>
-      <properties>
-        <installer.arch>arm64</installer.arch>
-      </properties>
-    </profile>
-    <!--
-      Auto-activates on Windows.
-    -->
-    <profile>
-      <id>windows-installer</id>
-      <activation>
-        <os>
-          <family>windows</family>
-        </os>
-      </activation>
-      <properties>
-        <jpackage.platform.args>--win-console --type msi --win-dir-chooser 
--win-menu --win-menu-group "Apache Hive" --win-shortcut-prompt --win-help-url 
https://hive.apache.org/ --license-file ${project.basedir}/../LICENSE 
--resource-dir 
${project.basedir}/src/main/jpackage/windows</jpackage.platform.args>
-      </properties>
-    </profile>
     <profile>
       <id>sources</id>
       <build>
@@ -387,7 +272,8 @@
             </goals>
             <configuration>
               <createDependencyReducedPom>false</createDependencyReducedPom>
-              <finalName>beeline-standalone</finalName>
+              <shadedArtifactAttached>true</shadedArtifactAttached>
+              <shadedClassifierName>standalone</shadedClassifierName>
               <transformers>
                 <transformer 
implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer"/>
                 <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
diff --git a/beeline/src/main/jpackage/windows/main.wxs 
b/beeline/src/main/jpackage/windows/main.wxs
deleted file mode 100644
index 74781e8edbe..00000000000
--- a/beeline/src/main/jpackage/windows/main.wxs
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  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.
--->
-<!--
-  Overrides the default main.wxs template that jpackage ships in the JDK
-  (src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs).
-  jpackage picks this file up automatically because it lives in the directory
-  passed via the resource-dir argument.
-
-  This copy is byte-identical to the JDK 21 template EXCEPT for three
-  additions, marked with "APACHE HIVE PATH ADDITION" below:
-
-    1. A public MSI property ADD_TO_PATH (default 1) that gates the PATH
-       component. Users doing silent installs can opt out with
-       msiexec /i beeline-<ver>.msi /qn ADD_TO_PATH=0.
-
-    2. A Component containing a WiX <Environment> element that appends the
-       install directory to the system PATH (System="yes"). The Component
-       lives in the INSTALLDIR directory and uses an HKLM RegistryValue as
-       its KeyPath so MSI can track component state across upgrades and
-       uninstalls. Permanent="no" ensures the PATH entry is removed on
-       uninstall.
-
-    3. A ComponentRef inside the Feature so the Component is actually
-       installed. Without this, WiX would compile the Component but MSI
-       would never activate it.
-
-  The rest of the template — upgrade/downgrade handling, ARP metadata,
-  shortcuts/files/file-associations component groups, custom-action
-  sequencing — must stay verbatim or jpackage's build will fail with
-  missing symbols. If jpackage's template changes in a future JDK, this
-  file needs a manual re-sync; the git-blame here should make the diff
-  obvious.
--->
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
-     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>
-
-  <?ifdef JpIsSystemWide ?>
-    <?define JpInstallScope="perMachine"?>
-  <?else?>
-    <?define JpInstallScope="perUser"?>
-  <?endif?>
-
-  <?define JpProductLanguage=1033 ?>
-  <?define JpInstallerVersion=200 ?>
-  <?define JpCompressedMsi=yes ?>
-
-  <?include $(var.JpConfigDir)/overrides.wxi ?>
-
-  <?ifdef JpAllowUpgrades ?>
-    <?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
-  <?else?>
-    <?define JpUpgradeVersionOnlyDetectUpgrade="yes"?>
-  <?endif?>
-  <?ifdef JpAllowDowngrades ?>
-    <?define JpUpgradeVersionOnlyDetectDowngrade="no"?>
-  <?else?>
-    <?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
-  <?endif?>
-
-  <Product
-    Id="$(var.JpProductCode)"
-    Name="$(var.JpAppName)"
-    Language="$(var.JpProductLanguage)"
-    Version="$(var.JpAppVersion)"
-    Manufacturer="$(var.JpAppVendor)"
-    UpgradeCode="$(var.JpProductUpgradeCode)">
-
-    <Package
-      Description="$(var.JpAppDescription)"
-      Manufacturer="$(var.JpAppVendor)"
-      InstallerVersion="$(var.JpInstallerVersion)"
-      Compressed="$(var.JpCompressedMsi)"
-      InstallScope="$(var.JpInstallScope)" Platform="x64"
-    />
-
-    <Media Id="1" Cabinet="Data.cab" EmbedCab="yes" />
-
-    <Upgrade Id="$(var.JpProductUpgradeCode)">
-      <UpgradeVersion
-        OnlyDetect="$(var.JpUpgradeVersionOnlyDetectUpgrade)"
-        Property="JP_UPGRADABLE_FOUND"
-        Maximum="$(var.JpAppVersion)"
-        MigrateFeatures="yes"
-        IncludeMaximum="$(var.JpUpgradeVersionOnlyDetectUpgrade)" />
-      <UpgradeVersion
-        OnlyDetect="$(var.JpUpgradeVersionOnlyDetectDowngrade)"
-        Property="JP_DOWNGRADABLE_FOUND"
-        Minimum="$(var.JpAppVersion)"
-        MigrateFeatures="yes"
-        IncludeMinimum="$(var.JpUpgradeVersionOnlyDetectDowngrade)" />
-    </Upgrade>
-
-    <?ifndef JpAllowUpgrades ?>
-    <CustomAction Id="JpDisallowUpgrade" 
Error="!(loc.DisallowUpgradeErrorMessage)" />
-    <?endif?>
-    <?ifndef JpAllowDowngrades ?>
-    <CustomAction Id="JpDisallowDowngrade" 
Error="!(loc.DowngradeErrorMessage)" />
-    <?endif?>
-
-    <Binary Id="JpCaDll" SourceFile="wixhelper.dll"/>
-
-    <CustomAction Id="JpFindRelatedProducts" BinaryKey="JpCaDll" 
DllEntry="FindRelatedProductsEx" />
-
-    <!-- Standard required root -->
-    <Directory Id="TARGETDIR" Name="SourceDir"/>
-
-    <!-- ==== APACHE HIVE PATH ADDITION (1/3): opt-out property ==== -->
-    <!--
-      Public MSI property. Uppercase means callers can set it on the
-      msiexec command line: `msiexec /i beeline.msi /qn ADD_TO_PATH=0`.
-      Secure="yes" lets the value survive the transition into the
-      elevated portion of the install sequence.
-    -->
-    <Property Id="ADD_TO_PATH" Value="1" Secure="yes"/>
-    <!-- ==== end APACHE HIVE PATH ADDITION (1/3) ==== -->
-
-    <Feature Id="DefaultFeature" Title="!(loc.MainFeatureTitle)" Level="1">
-      <ComponentGroupRef Id="Shortcuts"/>
-      <ComponentGroupRef Id="Files"/>
-      <ComponentGroupRef Id="FileAssociations"/>
-      <!-- ==== APACHE HIVE PATH ADDITION (2/3): pull component into feature 
==== -->
-      <ComponentRef Id="BeelinePathComponent"/>
-      <!-- ==== end APACHE HIVE PATH ADDITION (2/3) ==== -->
-    </Feature>
-
-    <!-- ==== APACHE HIVE PATH ADDITION (3/3): the PATH component itself ==== 
-->
-    <!--
-      Appends [INSTALLDIR] to the system PATH environment variable.
-      Gated by ADD_TO_PATH="1" so silent installs can opt out.
-      System="yes" writes to HKLM (machine-wide PATH); this only works
-      because we do not pass win-per-user-install, so the install is
-      elevated and has HKLM write access.
-      Permanent="no" tells WiX to remove the PATH entry on uninstall.
-      Part="last" appends rather than replaces or prepends.
-      The RegistryValue is the Component's KeyPath — MSI needs a KeyPath
-      per Component to track install/repair/uninstall state, and an
-      HKLM registry entry is the idiomatic choice for an Environment-only
-      component in a per-machine install.
-      Guid must be stable across releases; regenerate ONLY if the
-      Component's semantics fundamentally change.
-    -->
-    <DirectoryRef Id="INSTALLDIR">
-      <Component Id="BeelinePathComponent"
-                 Guid="6EFD65E5-AEE7-4E61-B891-127899E816E1">
-        <Condition>ADD_TO_PATH="1"</Condition>
-        <RegistryValue Root="HKLM"
-                       Key="Software\Apache\Hive\Beeline"
-                       Name="PathInstalled"
-                       Type="integer"
-                       Value="1"
-                       KeyPath="yes"/>
-        <Environment Id="BeelinePathEnv"
-                     Name="PATH"
-                     Value="[INSTALLDIR]"
-                     Permanent="no"
-                     Part="last"
-                     Action="set"
-                     System="yes"/>
-      </Component>
-    </DirectoryRef>
-    <!-- ==== end APACHE HIVE PATH ADDITION (3/3) ==== -->
-
-    <CustomAction Id="JpSetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" 
Value="[INSTALLDIR]" />
-    <CustomAction Id="JpSetARPCOMMENTS" Property="ARPCOMMENTS" 
Value="$(var.JpAppDescription)" />
-    <CustomAction Id="JpSetARPCONTACT" Property="ARPCONTACT" 
Value="$(var.JpAppVendor)" />
-    <CustomAction Id="JpSetARPSIZE" Property="ARPSIZE" 
Value="$(var.JpAppSizeKb)" />
-
-    <?ifdef JpHelpURL ?>
-      <CustomAction Id="JpSetARPHELPLINK" Property="ARPHELPLINK" 
Value="$(var.JpHelpURL)" />
-    <?endif?>
-
-    <?ifdef JpAboutURL ?>
-      <CustomAction Id="JpSetARPURLINFOABOUT" Property="ARPURLINFOABOUT" 
Value="$(var.JpAboutURL)" />
-    <?endif?>
-
-    <?ifdef JpUpdateURL ?>
-      <CustomAction Id="JpSetARPURLUPDATEINFO" Property="ARPURLUPDATEINFO" 
Value="$(var.JpUpdateURL)" />
-    <?endif?>
-
-    <?ifdef JpIcon ?>
-    <Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
-    <Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
-    <?endif?>
-
-    <UIRef Id="JpUI"/>
-
-    <InstallExecuteSequence>
-      <Custom Action="JpSetARPINSTALLLOCATION" After="CostFinalize">Not 
Installed</Custom>
-      <Custom Action="JpSetARPCOMMENTS" After="CostFinalize">Not 
Installed</Custom>
-      <Custom Action="JpSetARPCONTACT" After="CostFinalize">Not 
Installed</Custom>
-      <Custom Action="JpSetARPSIZE" After="CostFinalize">Not Installed</Custom>
-      <?ifdef JpHelpURL ?>
-        <Custom Action="JpSetARPHELPLINK" After="CostFinalize">Not 
Installed</Custom>
-      <?endif?>
-      <?ifdef JpAboutURL ?>
-        <Custom Action="JpSetARPURLINFOABOUT" After="CostFinalize">Not 
Installed</Custom>
-      <?endif?>
-      <?ifdef JpUpdateURL ?>
-        <Custom Action="JpSetARPURLUPDATEINFO" After="CostFinalize">Not 
Installed</Custom>
-      <?endif?>
-
-      <?ifndef JpAllowUpgrades ?>
-      <Custom Action="JpDisallowUpgrade" 
After="JpFindRelatedProducts">JP_UPGRADABLE_FOUND</Custom>
-      <?endif?>
-      <?ifndef JpAllowDowngrades ?>
-      <Custom Action="JpDisallowDowngrade" 
After="JpFindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
-      <?endif?>
-      <RemoveExistingProducts Before="CostInitialize"/>
-      <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
-    </InstallExecuteSequence>
-
-    <InstallUISequence>
-      <Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
-    </InstallUISequence>
-
-  </Product>
-</Wix>
diff --git 
a/itests/hive-unit/src/test/java/org/apache/hive/beeline/schematool/TestSchemaTool.java
 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaTool.java
similarity index 99%
rename from 
itests/hive-unit/src/test/java/org/apache/hive/beeline/schematool/TestSchemaTool.java
rename to 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaTool.java
index 50c835b23f4..389dee5ecef 100644
--- 
a/itests/hive-unit/src/test/java/org/apache/hive/beeline/schematool/TestSchemaTool.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaTool.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.hive.beeline.schematool;
+package org.apache.hadoop.hive.metastore.tools.schematool;
 
 import java.io.BufferedWriter;
 import java.io.File;
@@ -26,7 +26,6 @@
 
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.hadoop.hive.metastore.tools.schematool.HiveSchemaHelper;
 import 
org.apache.hadoop.hive.metastore.tools.schematool.HiveSchemaHelper.NestedScriptParser;
 import 
org.apache.hadoop.hive.metastore.tools.schematool.HiveSchemaHelper.PostgresCommandParser;
 import org.junit.Assert;
diff --git a/beeline/src/test/org/apache/hive/beeline/cli/HiveCliForTest.java 
b/itests/hive-unit/src/test/java/org/apache/hive/beeline/cli/HiveCliForTest.java
similarity index 100%
rename from beeline/src/test/org/apache/hive/beeline/cli/HiveCliForTest.java
rename to 
itests/hive-unit/src/test/java/org/apache/hive/beeline/cli/HiveCliForTest.java
diff --git a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java 
b/itests/hive-unit/src/test/java/org/apache/hive/beeline/cli/TestHiveCli.java
similarity index 96%
rename from beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java
rename to 
itests/hive-unit/src/test/java/org/apache/hive/beeline/cli/TestHiveCli.java
index 29f6606803b..afceaa2a34e 100644
--- a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java
+++ 
b/itests/hive-unit/src/test/java/org/apache/hive/beeline/cli/TestHiveCli.java
@@ -295,6 +295,11 @@ public static void init(){
   @Before
   public void setup() throws IOException, URISyntaxException {
     System.setProperty("datanucleus.schema.autoCreateAll", "true");
+    // itests/hive-unit's shared hive-site.xml enables 
hive.support.concurrency with the
+    // default ZooKeeper lock manager; this test uses an embedded, non-MiniHS2 
session with
+    // no ZooKeeper running, so it must use the in-process lock manager 
instead.
+    System.setProperty(HiveConf.ConfVars.HIVE_LOCK_MANAGER.varname,
+        "org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager");
     cli = new HiveCliForTest();
     redirectOutputStream();
     initFromFile();
diff --git a/packaging/pom.xml b/packaging/pom.xml
index 4171fa28994..d3dd24211ac 100644
--- a/packaging/pom.xml
+++ b/packaging/pom.xml
@@ -343,6 +343,7 @@
       <groupId>org.apache.hive</groupId>
       <artifactId>hive-beeline</artifactId>
       <version>${project.version}</version>
+      <classifier>standalone</classifier>
     </dependency>
     <dependency>
       <groupId>org.apache.hive</groupId>
diff --git a/packaging/src/main/assembly/beeline.xml 
b/packaging/src/main/assembly/beeline.xml
index 62f49137612..165fca85844 100644
--- a/packaging/src/main/assembly/beeline.xml
+++ b/packaging/src/main/assembly/beeline.xml
@@ -73,15 +73,6 @@
             </includes>
             <outputDirectory>/</outputDirectory>
         </fileSet>
-
-        <fileSet>
-            <fileMode>755</fileMode>
-            <directory>${project.parent.basedir}/beeline/target</directory>
-            <outputDirectory>lib</outputDirectory>
-            <includes>
-                <include>jar-with-dependencies.jar</include>
-            </includes>
-        </fileSet>
     </fileSets>
 
 </assembly>
diff --git a/standalone-metastore/metastore-server/pom.xml 
b/standalone-metastore/metastore-server/pom.xml
index 289fbcd40a6..b3c0437c24b 100644
--- a/standalone-metastore/metastore-server/pom.xml
+++ b/standalone-metastore/metastore-server/pom.xml
@@ -34,6 +34,11 @@
       <artifactId>hive-standalone-metastore-client</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.hive</groupId>
+      <artifactId>metastore-tools-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
@@ -318,10 +323,6 @@
       <artifactId>jsonassert</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>sqlline</groupId>
-      <artifactId>sqlline</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.jline</groupId>
       <artifactId>jline</artifactId>
diff --git a/standalone-metastore/metastore-tools/tools-common/pom.xml 
b/standalone-metastore/metastore-tools/tools-common/pom.xml
index 6c12e830ef7..4d15dc0f75e 100644
--- a/standalone-metastore/metastore-tools/tools-common/pom.xml
+++ b/standalone-metastore/metastore-tools/tools-common/pom.xml
@@ -44,6 +44,53 @@
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
     </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>sqlline</groupId>
+      <artifactId>sqlline</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-common</artifactId>
+      <optional>true</optional>
+      <exclusions>
+        <exclusion>
+          <groupId>com.nimbusds</groupId>
+          <artifactId>nimbus-jose-jwt</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-beanutils</groupId>
+          <artifactId>commons-beanutils</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-reload4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>ch.qos.reload4j</groupId>
+          <artifactId>reload4j</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.curator</groupId>
+          <artifactId>curator-framework</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
@@ -59,6 +106,12 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>${mockito-core.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreSchemaInfo.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreSchemaInfo.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreSchemaInfo.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreSchemaInfo.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfoFactory.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfoFactory.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfoFactory.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfoFactory.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/HiveSchemaHelper.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/HiveSchemaHelper.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/HiveSchemaHelper.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/HiveSchemaHelper.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/MetastoreSchemaTool.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/MetastoreSchemaTool.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/MetastoreSchemaTool.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/MetastoreSchemaTool.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolCommandLine.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolCommandLine.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolCommandLine.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolCommandLine.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTask.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTask.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTask.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTask.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskAlterCatalog.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskAlterCatalog.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskAlterCatalog.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskAlterCatalog.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateCatalog.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateCatalog.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateCatalog.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateCatalog.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateLogsTable.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateLogsTable.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateLogsTable.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateLogsTable.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateUser.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateUser.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateUser.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateUser.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskDrop.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskDrop.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskDrop.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskDrop.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInfo.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInfo.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInfo.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInfo.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInit.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInit.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInit.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInit.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInitOrUpgrade.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInitOrUpgrade.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInitOrUpgrade.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskInitOrUpgrade.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMergeCatalog.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMergeCatalog.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMergeCatalog.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMergeCatalog.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveDatabase.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveDatabase.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveDatabase.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveDatabase.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveTable.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveTable.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveTable.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskMoveTable.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskUpgrade.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskUpgrade.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskUpgrade.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskUpgrade.java
diff --git 
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java
 
b/standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
similarity index 92%
rename from 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
index 1c6c905704f..33a2e6e5e37 100644
--- 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
+++ 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaFactory.java
@@ -19,15 +19,12 @@
 package org.apache.hadoop.hive.metastore;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.metastore.annotation.MetastoreUnitTest;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
-@Category(MetastoreUnitTest.class)
 public class TestMetaStoreSchemaFactory {
   private Configuration conf;
 
@@ -59,7 +56,8 @@ public void testConstructor() {
     Class<?> clasz = null;
     try {
       clasz = conf.getClassByName(className);
-      clasz.getConstructor(String.class, String.class);
+      var unused = clasz.getConstructor(String.class, String.class);
+      Assert.assertNotNull(unused);
     } catch (NoSuchMethodException | IllegalArgumentException | 
ClassNotFoundException e) {
       throw new IllegalArgumentException(e);
     }
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
similarity index 95%
rename from 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
index c80a14482a5..11af3c0ae64 100644
--- 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
+++ 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreSchemaInfo.java
@@ -19,16 +19,13 @@
 
 package org.apache.hadoop.hive.metastore;
 
-import org.apache.hadoop.hive.metastore.annotation.MetastoreUnitTest;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.junit.Assert;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 
 /**
  * Test MetaStoreSchemaInfo
  */
-@Category(MetastoreUnitTest.class)
 public class TestMetaStoreSchemaInfo {
 
   @Test
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
similarity index 93%
rename from 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
index ceeb612fed0..b6954752246 100644
--- 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
+++ 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestMetastoreSchemaTool.java
@@ -19,12 +19,10 @@
 package org.apache.hadoop.hive.metastore.tools.schematool;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.metastore.annotation.MetastoreUnitTest;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.experimental.categories.Category;
 import org.mockito.Mock;
 
 import java.io.File;
@@ -34,7 +32,6 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-@Category(MetastoreUnitTest.class)
 public class TestMetastoreSchemaTool {
 
   private String scriptFile = System.getProperty("java.io.tmpdir") + 
File.separator + "someScript.sql";
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolTaskDrop.java
 
b/standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolTaskDrop.java
similarity index 100%
rename from 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolTaskDrop.java
rename to 
standalone-metastore/metastore-tools/tools-common/src/test/java/org/apache/hadoop/hive/metastore/tools/schematool/TestSchemaToolTaskDrop.java
diff --git a/standalone-metastore/pom.xml b/standalone-metastore/pom.xml
index be054c48669..f532004b138 100644
--- a/standalone-metastore/pom.xml
+++ b/standalone-metastore/pom.xml
@@ -71,7 +71,9 @@
     <antlr.version>4.9.3</antlr.version>
     
<apache-directory-server.version>2.0.0-M24</apache-directory-server.version>
     <checkstyle.version>11.1.0</checkstyle.version>
+    <commons-cli.version>1.5.0</commons-cli.version>
     <commons-collections4.version>4.4</commons-collections4.version>
+    <commons-io.version>2.16.1</commons-io.version>
     <commons-lang3.version>3.17.0</commons-lang3.version>
     <commons-dbcp2.version>2.14.0</commons-dbcp2.version>
     <datasketches.version>2.0.0</datasketches.version>
@@ -228,6 +230,16 @@
         <artifactId>ST4</artifactId>
         <version>${ST4.version}</version>
       </dependency>
+      <dependency>
+        <groupId>commons-cli</groupId>
+        <artifactId>commons-cli</artifactId>
+        <version>${commons-cli.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>${commons-io.version}</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>

Reply via email to