Site: update instructions as Avatica is migrated to Gradle
diff --git a/avatica/develop/avatica.html b/avatica/develop/avatica.html
index eaf6857..70673ce 100644
--- a/avatica/develop/avatica.html
+++ b/avatica/develop/avatica.html
@@ -90,10 +90,7 @@
 
 <ul id="markdown-toc">
   <li><a href="#source-code" id="markdown-toc-source-code">Source code</a></li>
-  <li><a href="#download-source-build-and-run-tests" id="markdown-toc-download-source-build-and-run-tests">Download source, build, and run tests</a>    <ul>
-      <li><a href="#disabling-protobuf-generation" id="markdown-toc-disabling-protobuf-generation">Disabling protobuf generation</a></li>
-    </ul>
-  </li>
+  <li><a href="#download-source-build-and-run-tests" id="markdown-toc-download-source-build-and-run-tests">Download source, build, and run tests</a></li>
   <li><a href="#contributing" id="markdown-toc-contributing">Contributing</a></li>
   <li><a href="#continuous-integration-testing" id="markdown-toc-continuous-integration-testing">Continuous Integration Testing</a></li>
   <li><a href="#getting-started" id="markdown-toc-getting-started">Getting started</a></li>
@@ -121,30 +118,13 @@
 
 <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>git clone git://github.com/apache/calcite-avatica.git avatica
 <span class="nv">$ </span><span class="nb">cd </span>avatica
-<span class="nv">$ </span>./mvnw install</code></pre></figure>
+<span class="nv">$ </span>./gradlew build</code></pre></figure>
 
 <p>The HOWTO describes how to
 <a href="/avatica/docs/howto.html#building-from-a-source-distribution">build from a source distribution</a>,
 <a href="/avatica/docs/howto.html#running-tests">run more or fewer tests</a> and
 <a href="/avatica/docs/howto.html#running-integration-tests">run integration tests</a>.</p>
 
-<h3 id="disabling-protobuf-generation">Disabling protobuf generation</h3>
-
-<p>On older operating systems, developers trying to build Avatica may experience
-issues with the Xolstice maven-protobuf-plugin, similar to the following:</p>
-
-<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[INFO] Compiling 3 proto file(s) to /avatica/core/src/main/java
-[ERROR] PROTOC FAILED: /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/common.proto [0:0]: /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/responses.proto [0:0]: /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-[ERROR] /avatica/core/src/main/protobuf/requests.proto [0:0]: /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /avatica/core/target/protoc-plugins/protoc-3.1.0-linux-x86_64.exe)
-</code></pre></div></div>
-
-<p>In most cases, it is unnecessary to re-generate the Protobuf messages into Java code. Developers
-can side-step this issue by disabling the <code class="highlighter-rouge">compile-protobuf</code> profile in their Maven execution.</p>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./mvnw package <span class="nt">-P</span><span class="o">!</span>compile-protobuf</code></pre></figure>
-
 <h2 id="contributing">Contributing</h2>
 
 <p>We welcome contributions.</p>
@@ -157,7 +137,7 @@
 <p>Fork the github repository, and create a branch for your feature.</p>
 
 <p>Develop your feature and test cases, and make sure that
-<code class="highlighter-rouge">./mvnw install</code> succeeds. (Run extra tests if your change warrants it.)</p>
+<code class="highlighter-rouge">./gradlew build</code> succeeds. (Run extra tests if your change warrants it.)</p>
 
 <p>Commit your change to your branch, and use a comment that starts with
 the JIRA case number, like this:</p>
diff --git a/avatica/docs/howto.html b/avatica/docs/howto.html
index 5549a00..29771db 100644
--- a/avatica/docs/howto.html
+++ b/avatica/docs/howto.html
@@ -779,9 +779,8 @@
 
 <ul id="markdown-toc">
   <li><a href="#building-from-a-source-distribution" id="markdown-toc-building-from-a-source-distribution">Building from a source distribution</a></li>
-  <li><a href="#building-from-git" id="markdown-toc-building-from-git">Building from git</a></li>
+  <li><a href="#building-from-git" id="markdown-toc-building-from-git">Building from Git</a></li>
   <li><a href="#running-tests" id="markdown-toc-running-tests">Running tests</a>    <ul>
-      <li><a href="#running-tests-in-your-environment" id="markdown-toc-running-tests-in-your-environment">Running tests in your environment</a></li>
       <li><a href="#to-run-tests-in-docker" id="markdown-toc-to-run-tests-in-docker">To run tests in docker:</a></li>
     </ul>
   </li>
@@ -793,17 +792,12 @@
       <li><a href="#run-a-gpg-agent" id="markdown-toc-run-a-gpg-agent">Run a GPG agent</a></li>
       <li><a href="#set-up-maven-repository-credentials-for-calcite-committers" id="markdown-toc-set-up-maven-repository-credentials-for-calcite-committers">Set up Maven repository credentials (for Calcite committers)</a></li>
       <li><a href="#making-a-snapshot-for-calcite-committers" id="markdown-toc-making-a-snapshot-for-calcite-committers">Making a snapshot (for Calcite committers)</a></li>
-      <li><a href="#making-a-release-for-calcite-committers" id="markdown-toc-making-a-release-for-calcite-committers">Making a release (for Calcite committers)</a>        <ul>
-          <li><a href="#to-perform-the-dry-run-directly-in-your-environment" id="markdown-toc-to-perform-the-dry-run-directly-in-your-environment">To perform the dry-run directly in your environment:</a></li>
-          <li><a href="#to-perform-the-dry-run-in-docker" id="markdown-toc-to-perform-the-dry-run-in-docker">To perform the dry-run in docker:</a></li>
-          <li><a href="#if-you-are-building-directly-in-your-environment" id="markdown-toc-if-you-are-building-directly-in-your-environment">If you are building directly in your environment:</a></li>
-          <li><a href="#if-you-are-building-using-docker" id="markdown-toc-if-you-are-building-using-docker">If you are building using docker:</a></li>
-          <li><a href="#to-build-directly-in-your-environment" id="markdown-toc-to-build-directly-in-your-environment">To build directly in your environment:</a></li>
-          <li><a href="#to-build-using-docker" id="markdown-toc-to-build-using-docker">To build using docker:</a></li>
-          <li><a href="#to-upload-the-artifacts-directly-in-your-environment" id="markdown-toc-to-upload-the-artifacts-directly-in-your-environment">To upload the artifacts directly in your environment:</a></li>
-          <li><a href="#to-upload-the-artifacts-using-docker" id="markdown-toc-to-upload-the-artifacts-using-docker">To upload the artifacts using docker:</a></li>
+      <li><a href="#making-a-release-candidate-for-calcite-committers" id="markdown-toc-making-a-release-candidate-for-calcite-committers">Making a release candidate (for Calcite committers)</a>        <ul>
+          <li><a href="#to-prepare-a-release-candidate-directly-in-your-environment" id="markdown-toc-to-prepare-a-release-candidate-directly-in-your-environment">To prepare a release candidate directly in your environment:</a></li>
+          <li><a href="#to-prepare-a-release-candidate-in-docker" id="markdown-toc-to-prepare-a-release-candidate-in-docker">To prepare a release candidate in Docker:</a></li>
         </ul>
       </li>
+      <li><a href="#checking-the-artifacts" id="markdown-toc-checking-the-artifacts">Checking the artifacts</a></li>
       <li><a href="#cleaning-up-after-a-failed-release-attempt-for-calcite-committers" id="markdown-toc-cleaning-up-after-a-failed-release-attempt-for-calcite-committers">Cleaning up after a failed release attempt (for Calcite committers)</a></li>
       <li><a href="#validate-a-release" id="markdown-toc-validate-a-release">Validate a release</a></li>
       <li><a href="#get-approval-for-a-release-via-apache-voting-process-for-calcite-committers" id="markdown-toc-get-approval-for-a-release-via-apache-voting-process-for-calcite-committers">Get approval for a release via Apache voting process (for Calcite committers)</a></li>
@@ -820,8 +814,7 @@
 
 <h2 id="building-from-a-source-distribution">Building from a source distribution</h2>
 
-<p>Prerequisites are maven (3.2.1 or later)
-and Java (JDK 8 or later) on your path.</p>
+<p>Prerequisites are Java (JDK 8 or later) on your path.</p>
 
 <p>Unpack the source distribution <code class="highlighter-rouge">.tar.gz</code> file,
 <code class="highlighter-rouge">cd</code> to the root directory of the unpacked source,
@@ -829,23 +822,26 @@
 
 <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span><span class="nb">tar </span>xvfz apache-calcite-avatica-1.15.0-src.tar.gz
 <span class="nv">$ </span><span class="nb">cd </span>apache-calcite-avatica-1.15.0-src
-<span class="nv">$ </span>./mvnw install</code></pre></figure>
+<span class="nv">$ </span>./gradlew build</code></pre></figure>
 
 <p><a href="#running-tests">Running tests</a> describes how to run more or fewer
 tests.</p>
 
-<h2 id="building-from-git">Building from git</h2>
+<h2 id="building-from-git">Building from Git</h2>
 
-<p>Prerequisites are git, maven (3.2.1 or later)
+<p>Prerequisites are Git,
 and Java (JDK 8 or later) on your path.</p>
 
-<p>Create a local copy of the github repository,
+<p>Create a local copy of the GitHub repository,
 <code class="highlighter-rouge">cd</code> to its root directory,
 then build using maven:</p>
 
 <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>git clone git://github.com/apache/calcite-avatica.git avatica
 <span class="nv">$ </span><span class="nb">cd </span>avatica
-<span class="nv">$ </span>./mvnw install</code></pre></figure>
+<span class="nv">$ </span>./gradlew build</code></pre></figure>
+
+<p>Note: <a href="https://github.com/dougborg/gdub">gdub</a> simplifies <code class="highlighter-rouge">./gradlew build</code> to <code class="highlighter-rouge">gw build</code>,
+and it simplifies cases like <code class="highlighter-rouge">../../gradlew ...</code> to <code class="highlighter-rouge">gw ...</code> as well.</p>
 
 <p><a href="#running-tests">Running tests</a> describes how to run more or fewer
 tests.</p>
@@ -853,15 +849,15 @@
 <h2 id="running-tests">Running tests</h2>
 
 <p>The test suite will run by default when you build, unless you specify
-<code class="highlighter-rouge">-DskipTests</code>.</p>
+<code class="highlighter-rouge">-x test</code></p>
 
-<h3 id="running-tests-in-your-environment">Running tests in your environment</h3>
+<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./gradlew assemble <span class="c"># build the artifacts</span>
+<span class="nv">$ </span>./gradlew build <span class="nt">-x</span> <span class="nb">test</span> <span class="c"># build the artifacts, verify code style, skip tests</span>
+<span class="nv">$ </span>./gradlew check <span class="c"># verify code style, execute tests</span>
+<span class="nv">$ </span>./gradlew <span class="nb">test</span> <span class="c"># execute tests</span>
+<span class="nv">$ </span>./gradlew checkstyleMain checkstyleTest <span class="c"># verify code style</span></code></pre></figure>
 
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./mvnw clean verify <span class="nt">-Dcheckstyle</span>.skip</code></pre></figure>
-
-<p>By default, invoking the <code class="highlighter-rouge">verify</code> Maven lifecycle phase will also cause checkstyle
-rules to be run. It is expected that contributions pass the checkstyle rules; however,
-it is common to ignore these while working on a feature/bug and fix them at the end.</p>
+<p>You can use <code class="highlighter-rouge">./gradlew assemble</code> to build the artifacts and skip all tests and verifications.</p>
 
 <h3 id="to-run-tests-in-docker">To run tests in docker:</h3>
 
@@ -932,7 +928,24 @@
 
 <h2 id="set-up-maven-repository-credentials-for-calcite-committers">Set up Maven repository credentials (for Calcite committers)</h2>
 
-<p>Follow the instructions <a href="http://www.apache.org/dev/publishing-maven-artifacts.html#dev-env">here</a> to add your credentials to your maven configuration.</p>
+<p>Gradle provides multiple ways to <a href="https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties">configure project properties</a>.
+For instance, you could update <code class="highlighter-rouge">$HOME/.gradle/gradle.properties</code>.</p>
+
+<p>Note: the build script would print the missing properties, so you can try running it and let it complain on the missing ones.</p>
+
+<p>The following options are used:</p>
+
+<figure class="highlight"><pre><code class="language-properties" data-lang="properties"><span class="py">asfCommitterId</span><span class="p">=</span>
+<span class="py">asfNexusUsername</span><span class="p">=</span>
+<span class="py">asfNexusPassword</span><span class="p">=</span>
+<span class="py">asfSvnUsername</span><span class="p">=</span>
+<span class="py">asfSvnPassword</span><span class="p">=</span></code></pre></figure>
+
+<p>Note: when https://github.com/vlsi/asflike-release-environment is used, the credentials are takend from
+<code class="highlighter-rouge">asfTest...</code> (e.g. <code class="highlighter-rouge">asfTestNexusUsername=test</code>)</p>
+
+<p>Note: if you want to uses <code class="highlighter-rouge">gpg-agent</code>, you need to pass <code class="highlighter-rouge">useGpgCmd</code> property, and specify the key id
+via <code class="highlighter-rouge">signing.gnupg.keyName</code>.</p>
 
 <h2 id="making-a-snapshot-for-calcite-committers">Making a snapshot (for Calcite committers)</h2>
 
@@ -946,11 +959,9 @@
 <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Make sure that there are no junk files in the sandbox</span>
 git clean <span class="nt">-xn</span>
 
-./mvnw <span class="nt">-Papache-release</span> clean install</code></pre></figure>
+./gradlew <span class="nt">-Pasf</span> publish</code></pre></figure>
 
-<p>When the dry-run has succeeded, change <code class="highlighter-rouge">install</code> to <code class="highlighter-rouge">deploy</code>.</p>
-
-<h2 id="making-a-release-for-calcite-committers">Making a release (for Calcite committers)</h2>
+<h2 id="making-a-release-candidate-for-calcite-committers">Making a release candidate (for Calcite committers)</h2>
 
 <p>Before you start:</p>
 
@@ -959,12 +970,12 @@
   <li>Make sure you are using JDK 8 (not 9 or 10).</li>
   <li>Check that <code class="highlighter-rouge">README</code>, <code class="highlighter-rouge">site/_docs/howto.md</code>, <code class="highlighter-rouge">site/_docs/docker_images.md</code> have the correct version number.</li>
   <li>Check that <code class="highlighter-rouge">NOTICE</code> has the current copyright year.</li>
-  <li>Set <code class="highlighter-rouge">version.major</code> and <code class="highlighter-rouge">version.minor</code> in <code class="highlighter-rouge">pom.xml</code>.</li>
+  <li>Check that <code class="highlighter-rouge">calcite.avatica.version</code> has the proper value in <code class="highlighter-rouge">/gradle.properties</code>.</li>
   <li>Add release notes to <code class="highlighter-rouge">site/_docs/history.md</code>. Include the commit history,
 and say which versions of Java, Guava and operating systems the release is
 tested against.</li>
   <li>Generate a report of vulnerabilities that occur among dependencies,
-using <code class="highlighter-rouge">./mvnw verify -Ppedantic</code>.</li>
+using <code class="highlighter-rouge">./gradlew dependencyCheckUpdate dependencyCheckAggregate</code>.</li>
   <li>Make sure that
 <a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20CALCITE%20AND%20status%20%3D%20Resolved%20and%20fixVersion%20is%20null">
 every “resolved” JIRA case</a> (including duplicates) has
@@ -972,49 +983,34 @@
 just about to release)</li>
 </ul>
 
-<p>Create a release branch named after the release, e.g.
-<code class="highlighter-rouge">branch-avatica-1.9</code>, and push it to Apache.</p>
+<p>The release candidate process does not add commits,
+so there’s no harm if it fails. It might leave <code class="highlighter-rouge">-rc</code> tag behind
+which can be removed if required.</p>
 
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>git checkout <span class="nt">-b</span> branch-avatica-X.Y
-<span class="nv">$ </span>git push <span class="nt">-u</span> origin branch-avatica-X.Y</code></pre></figure>
+<p>You can perform a dry-run release with a help of https://github.com/vlsi/asflike-release-environment
+That would perform the same steps, however it would push changes to the mock Nexus, Git, and SVN servers.</p>
 
-<p>We will use the branch for the entire the release process. Meanwhile,
-we do not allow commits to the master branch. After the release is
-final, we can use <code class="highlighter-rouge">git merge --ff-only</code> to append the changes on the
-release branch onto the master branch. (Apache does not allow reverts
-to the master branch, which makes it difficult to clean up the kind of
-messy commits that inevitably happen while you are trying to finalize
-a release.)</p>
-
-<p>Now, set up your environment and do a dry run. The dry run will not
-commit any changes back to git and gives you the opportunity to verify
-that the release process will complete as expected.</p>
-
-<p>If any of the steps fail, clean up (see below), fix the problem, and
+<p>If any of the steps fail, fix the problem, and
 start again from the top.</p>
 
-<p>To perform the dry-run, you can either use your environment or the release script and docker.</p>
+<h3 id="to-prepare-a-release-candidate-directly-in-your-environment">To prepare a release candidate directly in your environment:</h3>
 
-<h3 id="to-perform-the-dry-run-directly-in-your-environment">To perform the dry-run directly in your environment:</h3>
+<p>Pick a release candidate index and ensure it does not interfere with previous candidates for the version.</p>
 
 <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Make sure that there are no junk files in the sandbox</span>
 git clean <span class="nt">-xn</span>
 
-<span class="c"># Do a dry run of the release:prepare step, which sets version numbers.</span>
-<span class="c"># Typically we increment minor version: If X.Y.Z is 1.15.0, X2.Y2.Z2 is 1.16.0.</span>
-<span class="c"># Note X.Y.Z is the current version we're trying to release, and X2.Y2.Z2 is the next development version.</span>
+<span class="c"># Dry run the release candidate (push to asf-like-environment)</span>
+./gradlew prepareVote <span class="nt">-Prc</span><span class="o">=</span>1
 
-<span class="c"># For example, if I am currently building a release for 1.15.0, X.Y.Z would be 1.15.0 and X2.Y2.Z2 would be 1.16.0.</span>
-./mvnw <span class="nt">-DdryRun</span><span class="o">=</span><span class="nb">true</span> <span class="nt">-DreleaseVersion</span><span class="o">=</span>X.Y.Z <span class="nt">-DdevelopmentVersion</span><span class="o">=</span>X2.Y2.Z2-SNAPSHOT <span class="nt">-Dtag</span><span class="o">=</span>avatica-X.Y.Z-rcN <span class="nt">-Papache-release</span> <span class="nt">-Duser</span>.name<span class="o">=</span><span class="k">${</span><span class="nv">asf</span><span class="p">.username</span><span class="k">}</span> release:prepare
+<span class="c"># Push release candidate to ASF servers</span>
+./gradlew prepareVote <span class="nt">-Prc</span><span class="o">=</span>1 <span class="nt">-Pasf</span></code></pre></figure>
 
-<span class="c"># If you have multiple GPG keys, you can select the key used to sign the release by appending `-Dgpg.keyname=${your.key.id}` to `-Darguments`:</span>
-./mvnw <span class="nt">-DdryRun</span><span class="o">=</span><span class="nb">true</span> <span class="nt">-DreleaseVersion</span><span class="o">=</span>X.Y.Z <span class="nt">-DdevelopmentVersion</span><span class="o">=</span>X2.Y2.Z2-SNAPSHOT <span class="nt">-Dtag</span><span class="o">=</span>avatica-X.Y.Z-rcN <span class="nt">-Papache-release</span> <span class="nt">-Duser</span>.name<span class="o">=</span><span class="k">${</span><span class="nv">asf</span><span class="p">.username</span><span class="k">}</span> release:prepare <span class="nt">-Darguments</span><span class="o">=</span><span class="nt">-Dgpg</span>.keyname<span class="o">=</span><span class="k">${</span><span class="nv">your</span><span class="p">.key.id</span><span class="k">}</span></code></pre></figure>
-
-<h3 id="to-perform-the-dry-run-in-docker">To perform the dry-run in docker:</h3>
+<h3 id="to-prepare-a-release-candidate-in-docker">To prepare a release candidate in Docker:</h3>
 
 <ul>
   <li>
-    <p>You will need to have <a href="https://docs.docker.com/install/">docker</a> and <a href="https://docs.docker.com/compose/install/">Docker Compose</a> installed.</p>
+    <p>You will need to have <a href="https://docs.docker.com/install/">Docker</a> and <a href="https://docs.docker.com/compose/install/">Docker Compose</a> installed.</p>
   </li>
   <li>
     <p>The script expects you to mount your <code class="highlighter-rouge">~/.gnupg</code> directory into the <code class="highlighter-rouge">/.gnupg</code> directory in the container. Once mounted into the container,
@@ -1029,14 +1025,13 @@
 <span class="c"># On Windows</span>
 docker-compose run <span class="nt">-v</span> /c/Users/username/AppData/Roaming/gnupg:/.gnupg dry-run</code></pre></figure>
 
-<p>Check the artifacts:</p>
+<h2 id="checking-the-artifacts">Checking the artifacts</h2>
 
 <ul>
-  <li>In the <code class="highlighter-rouge">target</code> directory should be these 4 files, among others:
+  <li>In the <code class="highlighter-rouge">release/build/distributions</code> directory should be these 3 files, among others:
     <ul>
       <li>apache-calcite-avatica-X.Y.Z-src.tar.gz</li>
       <li>apache-calcite-avatica-X.Y.Z-src.tar.gz.asc</li>
-      <li>apache-calcite-avatica-X.Y.Z-src.tar.gz.asc.sha512</li>
       <li>apache-calcite-avatica-X.Y.Z-src.tar.gz.sha512</li>
     </ul>
   </li>
@@ -1051,8 +1046,8 @@
     </ul>
   </li>
   <li>Make sure that there is no <code class="highlighter-rouge">KEYS</code> file in the source distros</li>
-  <li>For each .jar (for example <code class="highlighter-rouge">core/target/avatica-core-X.Y.Z.jar</code>
-and <code class="highlighter-rouge">server/target/avatica-server-X.Y.Z-sources.jar</code>),
+  <li>For each .jar (for example <code class="highlighter-rouge">core/build/libs/avatica-core-X.Y.Z.jar</code>
+and <code class="highlighter-rouge">server/build/libs/avatica-server-X.Y.Z-sources.jar</code>),
 verify that the <code class="highlighter-rouge">META-INF</code> directory contains the correct
 contents for <code class="highlighter-rouge">DEPENDENCIES</code>, <code class="highlighter-rouge">LICENSE</code> and <code class="highlighter-rouge">NOTICE</code> per the
 source/classes contained. Refer to the ASF licensing documentation on
@@ -1060,41 +1055,6 @@
   <li>Check PGP, per <a href="https://httpd.apache.org/dev/verification.html">this</a></li>
 </ul>
 
-<p>If something is not correct, you can invoke the <code class="highlighter-rouge">release:clean</code> mojo to remove the
-generated files from your workspace:</p>
-
-<h3 id="if-you-are-building-directly-in-your-environment">If you are building directly in your environment:</h3>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash">./mvnw release:clean</code></pre></figure>
-
-<h3 id="if-you-are-building-using-docker">If you are building using docker:</h3>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash">docker-compose run clean</code></pre></figure>
-
-<p>If successful, remove the <code class="highlighter-rouge">-DdryRun</code> flag and run the release for real.</p>
-
-<h3 id="to-build-directly-in-your-environment">To build directly in your environment:</h3>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Prepare sets the version numbers, creates a tag, and pushes it to git.</span>
-<span class="c"># Typically we increment minor version: If X.Y.Z is 1.15.0, X2.Y2.Z2 is 1.16.0.</span>
-<span class="c"># Note X.Y.Z is the current version we're trying to release, and X2.Y2.Z2 is the next development version.</span>
-<span class="c"># For example, if I am currently building a release for 1.15.0, X.Y.Z would be 1.15.0 and X2.Y2.Z2 would be 1.16.0.</span>
-./mvnw <span class="nt">-DreleaseVersion</span><span class="o">=</span>X.Y.Z <span class="nt">-DdevelopmentVersion</span><span class="o">=</span>X2.Y2.Z2-SNAPSHOT <span class="nt">-Dtag</span><span class="o">=</span>avatica-X.Y.Z-rcN <span class="nt">-Papache-release</span> <span class="nt">-Duser</span>.name<span class="o">=</span><span class="k">${</span><span class="nv">asf</span><span class="p">.username</span><span class="k">}</span> release:prepare
-
-<span class="c"># If you have multiple GPG keys, you can select the key used to sign the release by appending `-Darguments=-Dgpg.keyname=${your.key.id}`:</span>
-./mvnw <span class="nt">-DreleaseVersion</span><span class="o">=</span>X.Y.Z <span class="nt">-DdevelopmentVersion</span><span class="o">=</span>X2.Y2.Z2-SNAPSHOT <span class="nt">-Dtag</span><span class="o">=</span>avatica-X.Y.Z-rcN <span class="nt">-Papache-release</span> <span class="nt">-Duser</span>.name<span class="o">=</span><span class="k">${</span><span class="nv">asf</span><span class="p">.username</span><span class="k">}</span> release:prepare <span class="nt">-Darguments</span><span class="o">=</span><span class="nt">-Dgpg</span>.keyname<span class="o">=</span><span class="k">${</span><span class="nv">your</span><span class="p">.key.id</span><span class="k">}</span>
-
-<span class="c"># Perform checks out the tagged version, builds, and deploys to the staging repository</span>
-./mvnw <span class="nt">-Papache-release</span> <span class="nt">-Duser</span>.name<span class="o">=</span><span class="k">${</span><span class="nv">asf</span><span class="p">.username</span><span class="k">}</span> release:perform <span class="nt">-Darguments</span><span class="o">=</span><span class="s2">"-DskipTests"</span></code></pre></figure>
-
-<h3 id="to-build-using-docker">To build using docker:</h3>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># On Linux:</span>
-docker-compose run <span class="nt">-v</span> ~/.gnupg:/.gnupg release
-
-<span class="c"># On Windows</span>
-docker-compose run <span class="nt">-v</span> /c/Users/username/AppData/Roaming/gnupg:/.gnupg release</code></pre></figure>
-
 <p>Verify the staged artifacts in the Nexus repository:</p>
 
 <ul>
@@ -1108,51 +1068,10 @@
 (or a similar URL)</li>
 </ul>
 
-<h3 id="to-upload-the-artifacts-directly-in-your-environment">To upload the artifacts directly in your environment:</h3>
-<p>Upload the artifacts via subversion to a staging area,
-https://dist.apache.org/repos/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN:</p>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Create a subversion workspace, if you haven't already</span>
-mkdir <span class="nt">-p</span> ~/dist/dev
-<span class="nb">pushd</span> ~/dist/dev
-svn co https://dist.apache.org/repos/dist/dev/calcite
-<span class="nb">popd</span>
-
-<span class="c"># Move the files into a directory</span>
-<span class="nb">cd </span>target
-mkdir ~/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN
-mv apache-calcite-avatica-<span class="k">*</span> ~/dist/dev/calcite/apache-calcite-avatica-X.Y.Z-rcN
-
-<span class="c"># Check in</span>
-<span class="nb">cd</span> ~/dist/dev/calcite
-svn add apache-calcite-avatica-X.Y.Z-rcN
-svn ci</code></pre></figure>
-
-<h3 id="to-upload-the-artifacts-using-docker">To upload the artifacts using docker:</h3>
-<p>This assumes that a release was built and the artifacts are in the <code class="highlighter-rouge">target</code> folder.</p>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash">docker-compose run publish-release-for-voting</code></pre></figure>
-
-<p>The automated process also generates a vote email that can be sent to the list. Please check the email and amend the
-contents as necessary.</p>
-
 <h2 id="cleaning-up-after-a-failed-release-attempt-for-calcite-committers">Cleaning up after a failed release attempt (for Calcite committers)</h2>
 
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Make sure that the tag you are about to generate does not already</span>
-<span class="c"># exist (due to a failed release attempt)</span>
-git tag
-
-<span class="c"># If the tag exists, delete it locally and remotely</span>
-git tag <span class="nt">-d</span> avatica-X.Y.Z
-git push origin :refs/tags/avatica-X.Y.Z
-
-<span class="c"># Remove modified files</span>
-./mvnw release:clean
-
-<span class="c"># Check whether there are modified files and if so, go back to the</span>
-<span class="c"># original git commit</span>
-git status
-git reset <span class="nt">--hard</span> HEAD</code></pre></figure>
+<p>If something is not correct, you can fix it, commit it, and prepare the next candidate.
+The release candidate tags might be kept for a while.</p>
 
 <h2 id="validate-a-release">Validate a release</h2>
 
@@ -1186,7 +1105,9 @@
 
 <h2 id="get-approval-for-a-release-via-apache-voting-process-for-calcite-committers">Get approval for a release via Apache voting process (for Calcite committers)</h2>
 
-<p>Release vote on dev list</p>
+<p>Release vote on dev list.
+Note: the draft mail is printed as the final step of <code class="highlighter-rouge">prepareVote</code> task,
+and you can find the draft in <code class="highlighter-rouge">/build/prepareVote/mail.txt</code></p>
 
 <figure class="highlight"><pre><code class="language-text" data-lang="text">To: dev@calcite.apache.org
 Subject: [VOTE] Release apache-calcite-avatica-X.Y.Z (release candidate N)
@@ -1284,7 +1205,7 @@
 (fill in release number and date appropriately).
 Uncheck “Send mail for this update”.</p>
 
-<p>Promote the staged nexus artifacts.</p>
+<p>Promote the staged nexus artifacts (this is automatic, however, the instructions are here just in case).</p>
 
 <ul>
   <li>Go to <a href="https://repository.apache.org/">https://repository.apache.org/</a> and login</li>
@@ -1299,48 +1220,21 @@
 after you have confirmed that the nexus artifacts were promoted properly.</p>
 
 <h3 id="publishing-directly-in-your-environment">Publishing directly in your environment:</h3>
-<p>Copy the Git tag:</p>
 
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash">git tag rel/avatica-X.Y.X avatica-X.Y.Z-rcN
-git push origin rel/avatica-X.Y.Z</code></pre></figure>
+<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Dry run publishing the release (push to asf-like-environment)</span>
+./gradlew publishDist <span class="nt">-Prc</span><span class="o">=</span>1
 
-<p>Check the artifacts into svn.</p>
+<span class="c"># Publish the release to ASF servers</span>
+./gradlew publishDist <span class="nt">-Prc</span><span class="o">=</span>1 <span class="nt">-Pasf</span></code></pre></figure>
 
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Get the release candidate.</span>
-mkdir <span class="nt">-p</span> ~/dist/dev
-<span class="nb">cd</span> ~/dist/dev
-svn co https://dist.apache.org/repos/dist/dev/calcite
+<p>If there are more than 2 releases in SVN (see https://dist.apache.org/repos/dist/release/calcite),
+clear out the oldest ones:</p>
 
-<span class="c"># Copy the artifacts. Note that the copy does not have '-rcN' suffix.</span>
-mkdir <span class="nt">-p</span> ~/dist/release
-<span class="nb">cd</span> ~/dist/release
-svn co https://dist.apache.org/repos/dist/release/calcite
-<span class="nb">cd </span>calcite
-cp <span class="nt">-rp</span> ../../dev/calcite/apache-calcite-avatica-X.Y.Z-rcN apache-calcite-avatica-X.Y.Z
-svn add apache-calcite-avatica-X.Y.Z
-
-<span class="c"># Check in.</span>
-svn ci</code></pre></figure>
-
-<p>Svnpubsub will publish to the
-<a href="https://dist.apache.org/repos/dist/release/calcite">release repo</a> and propagate to the
-<a href="http://www.apache.org/dyn/closer.cgi/calcite">mirrors</a> within 24 hours.</p>
-
-<p>If there are now more than 2 releases, clear out the oldest ones:</p>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nb">cd</span> ~/dist/release/calcite
-svn rm apache-calcite-avatica-X.Y.Z
-svn ci</code></pre></figure>
+<figure class="highlight"><pre><code class="language-bash" data-lang="bash">svn rm https://dist.apache.org/repos/dist/release/calcite/apache-calcite-avatica-X.Y.Z</code></pre></figure>
 
 <p>The old releases will remain available in the
 <a href="http://archive.apache.org/dist/calcite/">release archive</a>.</p>
 
-<p>Merge the release branch back to master and push it:</p>
-
-<figure class="highlight"><pre><code class="language-bash" data-lang="bash">git checkout master
-git merge branch-X.Y <span class="nt">--ff-only</span>
-git push origin master</code></pre></figure>
-
 <h3 id="publishing-a-release-using-docker">Publishing a release using docker:</h3>
 <p>This assumes that a rc release was tagged and pushed to the git repository.</p>