16 frontend = buildNpmPackage {
17 pname = "dependency-track-frontend";
20 src = fetchFromGitHub {
21 owner = "DependencyTrack";
24 hash = "sha256-M7UtyhIuEi6ebkjO8OM0VVi8LQ+VqeVIzBgQwIzSAzg=";
27 npmDepsHash = "sha256-ZU5D3ZXLaZ1m2YP6uZmpzahP2JQPL9tdOHOyN9fp/XA=";
29 makeCacheWritable = true;
31 # The prepack script runs the build script, which we'd rather do in the build phase.
32 npmPackFlags = [ "--ignore-scripts" ];
36 maven.buildMavenPackage rec {
38 pname = "dependency-track";
40 src = fetchFromGitHub {
41 owner = "DependencyTrack";
42 repo = "dependency-track";
44 hash = "sha256-Gx7tGkibSu+v4gGKC61EFwUsdruMh0t2gTnnNazjqco=";
48 ./0000-remove-frontend-download.patch
49 ./0001-add-junixsocket.patch
53 substituteInPlace pom.xml \
54 --replace-fail '<protocArtifact>''${tool.protoc.version}</protocArtifact>' \
55 "<protocCommand>${protobuf}/bin/protoc</protocCommand>"
58 mvnJdk = jre_headless;
59 mvnHash = "sha256-4QtWvsIFiS4d55y45tj3RLE4YYdXLrqpzqS7mOqRWYw=";
60 manualMvnArtifacts = [ "com.coderplus.maven.plugins:copy-rename-maven-plugin:1.0.1" ];
63 mvnDepsParameters = lib.escapeShellArgs [
64 "-Dmaven.test.skip=true"
69 mvnParameters = lib.escapeShellArgs [
70 "-Dmaven.test.skip=true"
74 "-Dservices.bom.merge.skip=false"
75 "-Dlogback.configuration.file=${src}/src/main/docker/logback.xml"
76 "-Dcyclonedx-cli.path=${lib.getExe cyclonedx-cli}"
81 cp -r ${frontend}/lib/node_modules/@dependencytrack/frontend/dist frontend/
85 mvn cyclonedx:makeBom -Dmaven.repo.local=$mvnDeps/.m2 \
86 org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
91 nativeBuildInputs = [ makeWrapper ];
96 install -Dm644 target/dependency-track-*.jar $out/share/dependency-track/dependency-track.jar
97 makeWrapper ${jre_headless}/bin/java $out/bin/dependency-track \
98 --add-flags "-jar $out/share/dependency-track/dependency-track.jar"
104 # passthru for nix-update
105 inherit (frontend) npmDeps;
107 inherit (nixosTests) dependency-track;
109 updateScript = nix-update-script { };
113 description = "Intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain";
114 homepage = "https://github.com/DependencyTrack/dependency-track";
115 license = lib.licenses.asl20;
116 maintainers = lib.teams.cyberus.members;
117 mainProgram = "dependency-track";
118 inherit (jre_headless.meta) platforms;