[[release-process-prereqs]]
= Appendix: Release Prereqs

:Notice: 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.
:page-partial:







This section (appendix) describes the prerequisites for the xref:comguide:ROOT:cutting-a-release.adoc[release process].

== Public/private key

The most important configuration you require is to set up public/private key pair.
This is used by the `maven-release-plugin` to sign the code artifacts.
See the page on xref:comguide:ROOT:key-generation.adoc[key generation] for more details.

In order to prepare the release, you'll (need to) have a `~/.gnupg` directory with the relevant files (`gpg.conf`, `pubring.gpg`, `secring.gpg` etc), and have `gpg` on your operating system PATH.

[NOTE]
====
If on Windows, the equivalent directory is `c:\users\xxx\appdata\roaming\gnupg`.
For `gpg`, use either http://cygwin.com[cygwin.com] or http://www.gpg4win.org[gpg4win.org].

Note also that the mSysGit version of `gpg.exe` (as provided by GitHub's bash client) is not compatible with that provided by cygwin; move it to one side and check that `gpg.exe` being used is that from gpg4win.

If you use Atlassian's SourceTree, this also bundles a version of `gpg.exe` that is not compatible (in `C:\Users\xxx\AppData\Local\Atlassian\SourceTree\git_local\usr\bin`); again, move it to one side and instead use the one provided by gpg4win.
====

== Maven `settings.xml`

During the release process the `maven-deploy-plugin` uploads the generated artifacts to a staging repo on the http://repository.apache.org[Apache repository manager].
This requires your Apache LDAP credentials to be specified in your `~/.m2/settings.xml` file:

[source,xml]
----
<settings>
  <servers>
    <server>
      <id>apache.releases.https</id>
      <username>xxxxxxx</username>
      <password>yyyyyyy</password>
    </server>
    ...
  </servers>
  ...
</settings>
----

where `xxxxxxx` and `yyyyyyy` are your Apache LDAP username and password.
For more information, see these http://www.apache.org/dev/publishing-maven-artifacts.html#dev-env[ASF docs].

[NOTE]
====
It is also possible to configure to use `.ssh` secure keys, and thereby avoid hardcoding your Apache LDAP password into your `.m2/settings.xml` file.
A description of how to do this can be found, for example, http://bval.apache.org/release-setup.html[here].
====

Also, set up keyphrase for `gpg`; this avoids being prompted during release:

[source,xml]
----
<profiles>
  <profile>
    <id>gpg</id>
    <properties>
      <gpg.executable>gpg2</gpg.executable>
      <gpg.passphrase>this is not really my passphrase</gpg.passphrase>
    </properties>
  </profile>
  ...
</profiles>

<activeProfiles>
  <activeProfile>gpg</activeProfile>
  ...
</activeProfiles>
----

