Maven warning about missing libuddev

Hello,

Given a maven project using this shell.nix

with import <nixpkgs> { };

mkShell {
  name = "java dev env";

  packages = [
    cacert
    maven
    git
    temurin-bin-21
    k9s
    dive
  ];
}

when running maven commands I get this warning :

[WARNING] Did not find udev library in operating system. Some features may not work.
[WARNING] Disk Store information requires libudev, which is not present.

I did find this article about fixing a similar issue for gradle but it doesn’t really help with my situation. While I am on nixos and using home manager:

  • there is no maven home manager program setting
  • the shell-nix is not using home manager as far as I can tell
  • I couldn’t find the “udev” package mentionned in the article either in nixpkgs or in home manager ( maybe I just missed it ?)

how can I get rid of the warning ?

with some help from a friend we figured it out :

with import <nixpkgs> { };

mkShell {
  name = "James dev env";

  packages = [
    cacert
    maven
    git
    temurin-bin-21
    k9s
    dive
  ];

  MAVEN_OPTS = "-Djna.library.path="  + lib.makeLibraryPath [pkgs.udev];
}

solves the problem