This is an automated email from the ASF dual-hosted git repository.
jhelou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new 781fa5caa4 [devscout] bootstraps reproductible dev env
781fa5caa4 is described below
commit 781fa5caa4985ff63c52e454dfcf619d51211e03
Author: Jean Helou <[email protected]>
AuthorDate: Fri Feb 20 13:01:12 2026 +0100
[devscout] bootstraps reproductible dev env
Our current build instructions request that the user install maven 3.6
but the build works just fine on the latest version.
On the other hand, they don't specify the version of the jdk to use to
compile the project (jdk 21 is necessary).
With this, I propose to use the nix package manager (available on both
linux and max) to precisely pin versions of all of these tools for as
long as they are in the nix cache or their source is available.
In this file I didn't go as far as to pin to specific software version
except for the major jdk version. It is possible to do so if it becomes
necessary.
---
docs/modules/community/pages/contributing.adoc | 12 ++++++
flake.lock | 27 ++++++++++++++
flake.nix | 51 ++++++++++++++++++++++++++
3 files changed, 90 insertions(+)
diff --git a/docs/modules/community/pages/contributing.adoc
b/docs/modules/community/pages/contributing.adoc
index 3c43430430..cd12338254 100644
--- a/docs/modules/community/pages/contributing.adoc
+++ b/docs/modules/community/pages/contributing.adoc
@@ -189,3 +189,15 @@ will solve the problem. Note any bug numbers your patch
addresses.
The reason for these rules is so that committers can easily see what you are
trying to achieve, it is their
responsibility to manage the code and review submissions, if you make it easy
for them to see what you are doing your
patch is more likely to be committed quickly.
+
+=== Experimental nix support
+
+There is work in progress to support a more reproductible dev environment so
you don't have to figure out what to install or how.
+
+If you already have the nix package manager installed you should be able to
use the following command to enter the predefined build env :
+
+```
+nix develop --no-update-lock-file
+```
+
+If you encounter an issue, leave a comment on the corresponding jira issue
https://issues.apache.org/jira/browse/JAMES-4175[JAMES-4175] or create a bug
and link it as related to
https://issues.apache.org/jira/browse/JAMES-4175[JAMES-4175]
\ No newline at end of file
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000..dd9771a81b
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1771419570,
+ "narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-25.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000..cc9b2638f1
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,51 @@
+{
+ description = "James dev env";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
+
+ outputs = { self, nixpkgs }:
+ let
+ javaVersion = 21; # Change this value to update the whole stack
+
+ supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin"
"aarch64-darwin" ];
+ forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems
(system: f {
+ pkgs = import nixpkgs { inherit system; overlays = [
self.overlays.default ]; };
+ });
+ in
+ {
+ overlays.default =
+ final: prev:
+ let
+ jdk = prev."temurin-bin-${toString javaVersion}";
+ in
+ {
+ inherit jdk;
+ maven = prev.maven.override { jdk_headless = jdk; };
+ # gradle = prev.gradle.override { java = jdk; };
+ };
+
+ devShells = forEachSupportedSystem ({ pkgs }: {
+ default = pkgs.mkShell {
+ packages = with pkgs; [
+ antora # build documentation
+ cacert # ssl certificate management
+ dive # explore generated docker images
+ git # version control
+ jdk # build and run james
+ jekyll # homepage and blog
+ maven # build james
+ ];
+ MAVEN_OPTS = "-Djna.library.path=" + pkgs.lib.makeLibraryPath
[pkgs.udev];
+ JAVA_HOME = "${pkgs.jdk}";
+ shellHook =
+ let
+ prev = "\${JAVA_TOOL_OPTIONS:+ $JAVA_TOOL_OPTIONS}";
+ in
+ ''
+ export JAVA_TOOL_OPTIONS="${prev}"
+ echo "Experimental JAMES development environment activated"
+ '';
+ };
+ });
+ };
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]