No known key found for this signature in database
GPG Key ID: B4C3BF012D9B26BE
2 changed files with
2149 additions and
0 deletions
-
default.nix
-
mvn2nix-lock.json
|
@ -0,0 +1,50 @@ |
|
|
|
|
|
{ pkgs |
|
|
|
|
|
, stdenv |
|
|
|
|
|
, fetchFromGitHub |
|
|
|
|
|
, jdk17_headless |
|
|
|
|
|
, maven |
|
|
|
|
|
, nix-gitignore |
|
|
|
|
|
, makeWrapper |
|
|
|
|
|
, ... |
|
|
|
|
|
}: |
|
|
|
|
|
|
|
|
|
|
|
let |
|
|
|
|
|
mvn2nix = fetchFromGitHub { |
|
|
|
|
|
owner = "fzakaria"; |
|
|
|
|
|
repo = "mvn2nix"; |
|
|
|
|
|
rev = "master"; |
|
|
|
|
|
hash = "sha256-v/HvYqzkPaGin1ujo+Fi59wXC9vWxW3lYVSwElORRi8="; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
repository = (pkgs.callPackage "${mvn2nix}/maven.nix" {}).buildMavenRepositoryFromLockFile { |
|
|
|
|
|
file = ./mvn2nix-lock.json; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec { |
|
|
|
|
|
name = "ldap-sync"; |
|
|
|
|
|
|
|
|
|
|
|
src = nix-gitignore.gitignoreSource [] ./.; |
|
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ jdk17_headless maven makeWrapper ]; |
|
|
|
|
|
|
|
|
|
|
|
buildPhase = '' |
|
|
|
|
|
mvn --offline -Dmaven.repo.local=${repository} package -DskipTests; |
|
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
|
|
testPhase = '' |
|
|
|
|
|
mvn --offline -Dmaven.repo.local=${repository} verify; |
|
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
|
|
installPhase = '' |
|
|
|
|
|
ls -l target |
|
|
|
|
|
install -Dm644 target/${name}-1.0-SNAPSHOT-jar-with-dependencies.jar $out/share/java/${name}.jar |
|
|
|
|
|
|
|
|
|
|
|
makeWrapper ${jdk17_headless}/bin/java $out/bin/${name} \ |
|
|
|
|
|
--add-flags "-jar $out/share/java/${name}.jar" |
|
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
|
|
passthru = { |
|
|
|
|
|
inherit repository; |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|