Skip to content

Build from source

Building from source works on any machine with Java 25, including those that no release binary covers. You need a copy of the Witnyx repository, Java 25 or later and Maven 3.9 or later. The build checks both versions and stops when one is older.

In the repository’s root folder:

Terminal window
mvn -q verify

This builds both modules, witnyx-core and witnyx-cli, runs their tests, and writes:

  • witnyx-cli/target/witnyx-cli-0.1.0-SNAPSHOT.jar, the command-line tool in one JAR;
  • target/witnyx-sbom.cdx.json, Witnyx’s own software bill of materials (SBOM) in CycloneDX format. The CycloneDX Maven plugin needs Maven online, so an offline build (mvn -o) does not write it.

To build the JAR without running the tests:

Terminal window
mvn -q package -DskipTests
Terminal window
java -jar witnyx-cli/target/witnyx-cli-0.1.0-SNAPSHOT.jar version

The examples on this site call the tool witnyx. To do the same in bash or zsh, define an alias with the absolute path of the JAR:

Terminal window
alias witnyx='java -jar /absolute/path/to/witnyx-cli/target/witnyx-cli-0.1.0-SNAPSHOT.jar'

witnyx version then prints the version, the cache folder and the age of each public list in the cache. Before the first check, nothing is cached:

Terminal window
$ witnyx version
cisa-kev: not cached
enisa-euvd: not cached
endoflife-date: not cached

To check Witnyx’s own SBOM with the tool you built:

Terminal window
witnyx check target/witnyx-sbom.cdx.json --fail-on exploited --no-agent

The native Maven profile builds a native executable with GraalVM Community for JDK 25. The executable needs no Java to run. Point GRAALVM_HOME or JAVA_HOME at GraalVM, then:

Terminal window
mvn -Pnative -pl witnyx-cli -am package -DskipTests
witnyx-cli/target/witnyx version

On Windows the executable is witnyx-cli/target/witnyx.exe. On Linux, everything except the GNU C library (glibc) is linked into the executable.

The Dockerfile in the repository’s root folder compiles the native binary from the JAR inside GraalVM’s build image. It then copies the binary onto a minimal runtime image, which has no shell and runs as a user without root rights. It builds for the architecture of your machine only.

Terminal window
mvn -q package -DskipTests
docker build -t witnyx:dev .
docker run --rm witnyx:dev version

The image’s working folder is /work. Mount your project there to check it:

Terminal window
docker run --rm --volume "$PWD:/work" witnyx:dev check bom.json

Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.