[[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 appendix describes the prerequisites for the xref:comguide:ROOT:cutting-a-release.adoc[release process].

== Software

Instructions here are for Linux.

* jdk 21
+
[source,bash]
----
sdk install java 21...
----
+
NOTE: for v2.x branch of Causeway we target Java 11 but we still build with the more recent version of Java.

* mvn 3.9.7
+
[source,bash]
----
sdk install maven 3.9.7
----

* groovy 3.x
+
[source,bash]
----
sdk install groovy 3.0.21
----

* jq
+
[source,bash]
----
sudo apt update
sudo apt install jq
----

* pandoc 2.x
+
[source,bash]
----
sudo apt update
sudo apt install pandoc
----

* dos2unix (if building on Windows)

* Node LTS
+
Antora recommend using `nvm` (Node version manager) to install Node:

** install nvm
+
[source,bash]
----
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
----

** install LTS version of node:
+
[source,bash]
----
nvm install --lts
----

* Antora itself
+
[source,bash]
----
npm i -g @antora/cli@^3.1.7 @antora/site-generator@^3.1.7 asciidoctor-kroki@0.17.0
npm i -g serve@^13.0.2
----



== 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>
----

[#doc-tooling]
== Doc Tooling

NOTE: See also link:https://github.com/apache-causeway-committers/causewaystuff/blob/main/tooling/cli/README.adoc[causewaystuff] documentation.

In the `apache-causeway-committers/causewaystuff` repo:

* check out `main` branch

* install/use Java 21
+
For example:
+
[source,java]
----
sdk use java 21...
----

* build the tooling
+
[source,bash,subs="attributes+"]
----
mvn -D module-tooling install -Dskip.essential
----

In the regular `causeway` repo:

* Create a symlink to the `causewaystuff-tooling-cli` jar file
+
eg:
+
[source,bash]
.scripts/ln-tooling-jar.sh
----
mkdir -p tooling/cli/target
pushd tooling/cli/target
rm -f causewaystuff-tooling-cli.jar
ln -s $HOME/.m2/repository/io/github/causewaystuff/causewaystuff-tooling-cli/1.0.0-SNAPSHOT/causewaystuff-tooling-cli-1.0.0-SNAPSHOT-spring-boot.jar causewaystuff-tooling-cli.jar
popd
----
+
and then:
+
[source,bash]
.scripts/ln-tooling-jar.sh
----
sh ./scripts/ln-tooling-jar.sh
----

