dependency-track: init at 4.11.7
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 9988e765..906917c0 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -660,38 +660,13 @@
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
- <execution>
|
||||
- <id>frontend-download</id>
|
||||
- <phase>prepare-package</phase>
|
||||
- <configuration>
|
||||
- <target>
|
||||
- <get src="https://github.com/DependencyTrack/frontend/releases/download/${frontend.version}/frontend-dist.zip" dest="${project.build.directory}" verbose="true"/>
|
||||
- </target>
|
||||
- </configuration>
|
||||
- <goals>
|
||||
- <goal>run</goal>
|
||||
- </goals>
|
||||
- </execution>
|
||||
- <execution>
|
||||
- <id>frontend-extract</id>
|
||||
- <phase>prepare-package</phase>
|
||||
- <configuration>
|
||||
- <target>
|
||||
- <unzip src="${project.build.directory}/frontend-dist.zip" dest="${project.build.directory}/frontend">
|
||||
- </unzip>
|
||||
- </target>
|
||||
- </configuration>
|
||||
- <goals>
|
||||
- <goal>run</goal>
|
||||
- </goals>
|
||||
- </execution>
|
||||
<execution>
|
||||
<id>frontend-resource-deploy</id>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.directory}/${project.artifactId}">
|
||||
- <fileset dir="${project.build.directory}/frontend/dist">
|
||||
+ <fileset dir="${project.basedir}/frontend/dist">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
@@ -0,0 +1,17 @@
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 9988e765..f69576b4 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -457,6 +457,12 @@
|
||||
<version>${lib.testcontainers.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
+ <dependency>
|
||||
+ <groupId>com.kohlschutter.junixsocket</groupId>
|
||||
+ <artifactId>junixsocket-core</artifactId>
|
||||
+ <version>2.10.0</version>
|
||||
+ <type>pom</type>
|
||||
+ </dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
fetchFromGitHub,
|
||||
jre_headless,
|
||||
cyclonedx-cli,
|
||||
makeWrapper,
|
||||
maven,
|
||||
nix-update-script,
|
||||
}:
|
||||
let
|
||||
version = "4.11.7";
|
||||
|
||||
frontend = buildNpmPackage {
|
||||
pname = "dependency-track-frontend";
|
||||
inherit version;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DependencyTrack";
|
||||
repo = "frontend";
|
||||
rev = version;
|
||||
hash = "sha256-hgBDzzG90gunnlZeektzdBIdatNjbkDVmNLbxjyxAXE=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-veyt7fn4g/eh/+2CapQxlEssZP8cQXONpI6sSW299tk=";
|
||||
forceGitDeps = true;
|
||||
makeCacheWritable = true;
|
||||
|
||||
# The prepack script runs the build script, which we'd rather do in the build phase.
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
};
|
||||
in
|
||||
|
||||
maven.buildMavenPackage rec {
|
||||
inherit version;
|
||||
pname = "dependency-track";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "DependencyTrack";
|
||||
repo = "dependency-track";
|
||||
rev = version;
|
||||
hash = "sha256-BMkn9WnUGs4RxH5I1QQ2UDrlo32JcbfjfFcOG5YogLI=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./0000-remove-frontend-download.patch
|
||||
./0001-add-junixsocket.patch
|
||||
];
|
||||
|
||||
mvnJdk = jre_headless;
|
||||
mvnHash = "sha256-c/JwBiKsXuWbCm1dTCrVc+V/1G7Eii1mUW8xDyewyLs=";
|
||||
manualMvnArtifacts = [ "com.coderplus.maven.plugins:copy-rename-maven-plugin:1.0.1" ];
|
||||
buildOffline = true;
|
||||
|
||||
mvnDepsParameters = lib.escapeShellArgs [
|
||||
"-Dmaven.test.skip=true"
|
||||
"-P enhance"
|
||||
"-P embedded-jetty"
|
||||
];
|
||||
|
||||
mvnParameters = lib.escapeShellArgs [
|
||||
"-Dmaven.test.skip=true"
|
||||
"-P enhance"
|
||||
"-P embedded-jetty"
|
||||
"-P bundle-ui"
|
||||
"-Dservices.bom.merge.skip=false"
|
||||
"-Dlogback.configuration.file=${src}/src/main/docker/logback.xml"
|
||||
"-Dcyclonedx-cli.path=${lib.getExe cyclonedx-cli}"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
mkdir -p frontend
|
||||
cp -r ${frontend}/lib/node_modules/@dependencytrack/frontend/dist frontend/
|
||||
'';
|
||||
|
||||
afterDepsSetup = ''
|
||||
mvn cyclonedx:makeBom -Dmaven.repo.local=$mvnDeps/.m2 \
|
||||
org.codehaus.mojo:exec-maven-plugin:exec@merge-services-bom
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm644 target/dependency-track-*.jar $out/share/dependency-track/dependency-track.jar
|
||||
makeWrapper ${jre_headless}/bin/java $out/bin/dependency-track \
|
||||
--add-flags "-jar $out/share/dependency-track/dependency-track.jar"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
# passthru for nix-update
|
||||
inherit (frontend) npmDeps;
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Intelligent Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain";
|
||||
homepage = "https://github.com/DependencyTrack/dependency-track";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = lib.teams.cyberus.members;
|
||||
mainProgram = "dependency-track";
|
||||
inherit (jre_headless.meta) platforms;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user