1. Classic LOCKSS Development
Note
This page is under construction.
The code base of the Classic LOCKSS system (version 1.x) is contained in a single Git repository, https://github.com/lockss/lockss-daemon.
1.1. Prerequisites
To do development work with the Classic LOCKSS system (version 1.x), you will need:
Java 8 Development Kit (JDK 8), for example OpenJDK 8
Python 3, invoked as python3
Some scripts require Python 2.7, invoked as python2
Some runtime contexts that process split Zip files and some unit tests require the zip program (zip and unzip are installed by default on most Linux systems).
1.1.1. Installing Git
You can check if Git is installed on your system by typing git --version at the command line and seeing if you get a valid response. If you need to install Git, select your operating system below and follow the instructions (as root, except for Homebrew on MacOS):
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Pacman command (as root):
pacman -Sy --noconfirm git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Yum command (as root):
yum --assumeyes install git
To install Git, run these Apt commands (as root):
apt update
apt install --assume-yes git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Yum command (as root):
yum --assumeyes install git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run these Apt commands (as root):
apt update
apt install --assume-yes git
To install Git, run this Homebrew command:
brew install git
To install Git, run this MacPorts command (as root):
sudo port install git
To install Git, run these Zypper commands (as root):
zypper refresh
zypper --non-interactive install git
To install Git, run these Zypper commands (as root):
zypper refresh
zypper --non-interactive install git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Yum command (as root):
yum --assumeyes install git
To install Git, run this Yum command (as root):
yum --assumeyes install git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Dnf command (as root):
dnf --assumeyes install git
To install Git, run this Yum command (as root):
yum --assumeyes install git
To install Git, run these Apt commands (as root):
apt update
apt install --assume-yes git
1.1.2. Installing the Java Development Kit
You can check if a Java Development Kit (JDK) is installed on your system by typing
javac -versionat the command line and seeing if you get a valid response. (The version numbers output by Java 8 software sometimes use the notation 1.8, for example1.8.0_382.)If you need to install a JDK, we recommend OpenJDK; select your operating system below and follow the instructions (as
root, except for Homebrew on MacOS):To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Pacman command (as
root):pacman -Sy --noconfirm jdk8-openjdk
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Yum command (as
root):yum --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run these Apt commands (as
root):apt update apt install --assume-yes openjdk-8-jdk
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Yum command (as
root):yum --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run these Apt commands (as
root):apt update apt install --assume-yes openjdk-8-jdk
To install OpenJDK, run this Homebrew command:
brew install openjdk@8
Note
You may be directed to create symlinks and/or update your
PATHto make OpenJDK visible to your system, for instance:For the system Java wrappers to find this JDK, symlink it with sudo ln -sfn /usr/local/opt/openjdk@8/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-8.jdk openjdk@8 is keg-only, which means it was not symlinked into /usr/local, because this is an alternate version of another formula. If you need to have openjdk@8 first in your PATH, run: echo 'export PATH="/usr/local/opt/openjdk@8/bin:$PATH"' >> ~/.zshrc For compilers to find openjdk@8 you may need to set: export CPPFLAGS="-I/usr/local/opt/openjdk@8/include"
To install OPenJDK, run this MacPorts command (as
root):sudo port install openjdk
To install OpenJDK, run these Zypper commands (as
root):zypper refresh zypper --non-interactive install java-1_8_0-openjdk-devel
To install OpenJDK, run these Zypper commands (as
root):zypper refresh zypper --non-interactive install java-1_8_0-openjdk-devel
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Yum command (as
root):yum --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Yum command (as
root):yum --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Dnf command (as
root):dnf --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run this Yum command (as
root):yum --assumeyes install java-1.8.0-openjdk-devel
To install OpenJDK, run these Apt commands (as
root):apt update apt install --assume-yes openjdk-8-jdk
Set the
JAVA_HOMEenvironment variable to the directory in which the JDK is installed, for example/usr/lib/jvm/java-8-openjdkor similar for Linux or/usr/local/opt/openjdk@8/libexec/openjdk.jdk/Homefor MacOS with Homebrew. It is expected that the file$JAVA_HOME/lib/tools.jarexists.
1.1.3. Installing Apache Ant
You can check if Ant is installed on your system by typing ant -version at the command line and seeing if you get a valid response. If you need to install Ant, select your operating system below and follow the instructions (as root, except for Homebrew on MacOS):
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Pacman command (as root):
pacman -Sy --noconfirm ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Yum command (as root):
yum --assumeyes install ant
To install Ant, run these Apt commands (as root):
apt update
apt install --assume-yes ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Yum command (as root):
yum --assumeyes install ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run these Apt commands (as root):
apt update
apt install --assume-yes ant
To install Ant, run this Homebrew command:
brew install ant
To install Ant, run this MacPorts command (as root):
sudo port install apache-ant
To install Ant, run these Zypper commands (as root):
zypper refresh
zypper --non-interactive install ant
To install Ant, run these Zypper commands (as root):
zypper refresh
zypper --non-interactive install ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Yum command (as root):
yum --assumeyes install ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Yum command (as root):
yum --assumeyes install ant
To install Ant, run this Dnf command (as root):
dnf --assumeyes install ant
To install Ant, run this Yum command (as root):
yum --assumeyes install ant
To install Ant, run these Apt commands (as root):
apt update
apt install --assume-yes ant
1.1.4. Cloning the Git Repository
To clone the lockss-daemon repository from Git, use one of these commands:
# GitHub account with SSH key
git clone git@github.com:lockss/lockss-daemon
# Anonymous access
git clone https://github.com/lockss/lockss-daemon
This will create a lockss-daemon directory.
1.1.5. JUnit Prerequisites
JUnit 3.8.1 is included is included in the LOCKSS source distribution to run unit tests, but the Ant targets that invoke JUnit (test-xxx) require the JUnit JAR to be on Ant's CLASSPATH. The easiest way to do this is to copy lib/junit.jar (relative to the root of the lockss-daemon Git tree) into Ant's lib directory (relative to its installation directory on the system).
1.2. Tour of lockss-daemon
The main components of the lockss-daemon repository are as follows:
build.xmlis the Ant build file. Typeant -projecthelp(orant -p) will output a list of available build targets. Thelibdirectory contains Java (JAR) dependencies for the project at large.The
srctree contains the source code of the LOCKSS system proper, andtest/srcits unit tests. Theant/srctree contains the source code for an ancillary prerequisite.The
plugins/srctree contains the source code of plugins written by the LOCKSS Program to support the preservation activities of LOCKSS networks such as the Global LOCKSS Network (GLN) and the CLOCKSS Archive, andplugins/test/srcthe unit tests.The
tools/srctree contains the source code of ancillary tools sometimes used in the context of LOCKSS development, andtools/test/srcthe unit tests.The
tdbdirectory contains the archival unit (AU) inventory of content managed by the LOCKSS Program on behalf of various LOCKSS networks such as the GLN and CLOCKSS.The
scriptsandtest/scriptsdirectories contains scripts and tools used for TDB file processing, SOAP Web services, and more.The
test/frameworkstree contains multiple testing frameworks, to bring up one or more instance of the (classic) LOCKSS system on the local machine for testing or development purposes.