From a4a26f3e2855efd5ee586da03f39cd2170ac263b Mon Sep 17 00:00:00 2001 From: Oliver <20188437+olivergrabinski@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:40:02 +0100 Subject: [PATCH 1/2] Publish nexus storage fat jar --- .github/workflows/ci-snapshot.yml | 3 ++- build.sbt | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-snapshot.yml b/.github/workflows/ci-snapshot.yml index 84ce50dc60..71ea45714f 100644 --- a/.github/workflows/ci-snapshot.yml +++ b/.github/workflows/ci-snapshot.yml @@ -45,7 +45,8 @@ jobs: echo ${{ secrets.DOCKER_PASS }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin sbt -Dsbt.color=always -Dsbt.supershell=false \ app/Docker/publish \ - storage/Docker/publish + storage/Docker/publish \ + storage/Universal/publish - name: Publish to Github Packages run: | sbt -Dsbt.color=always -Dsbt.supershell=false publish diff --git a/build.sbt b/build.sbt index 13561fef89..5fdba0c5c6 100755 --- a/build.sbt +++ b/build.sbt @@ -724,13 +724,14 @@ lazy val cargo = taskKey[(File, String)]("Run Cargo to build 'nexus-fixer'") lazy val storage = project .in(file("storage")) - .enablePlugins(UniversalPlugin, JavaAppPackaging, JavaAgent, DockerPlugin, BuildInfoPlugin) + .enablePlugins(UniversalPlugin, UniversalDeployPlugin, JavaAppPackaging, JavaAgent, DockerPlugin, BuildInfoPlugin) .settings( shared, compilation, assertJavaVersion, kamonSettings, storageAssemblySettings, + storageFatJar, coverage, release, servicePackaging, @@ -882,6 +883,17 @@ lazy val kamonSettings = Seq( javaAgents += kanelaAgent ) +lazy val storageFatJar = Seq( + Universal / mappings := { + val fatJar = (Compile / assembly).value + val filteredMappings = (Universal / mappings).value filter { + case (_, name) if name.contains("kanela-agent") => true + case (_, name) => !name.endsWith(".jar") + } + filteredMappings :+ (fatJar -> ("lib/" + fatJar.getName)) + } +) + lazy val storageAssemblySettings = Seq( assembly / test := {}, assembly / assemblyOutputPath := baseDirectory.value / "nexus-storage.jar", From 67974c653644a67436366eaa91fe5a14808b8f31 Mon Sep 17 00:00:00 2001 From: Oliver <20188437+olivergrabinski@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:57:06 +0100 Subject: [PATCH 2/2] Fix storage docker image --- build.sbt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 5fdba0c5c6..c148a7e78b 100755 --- a/build.sbt +++ b/build.sbt @@ -891,12 +891,13 @@ lazy val storageFatJar = Seq( case (_, name) => !name.endsWith(".jar") } filteredMappings :+ (fatJar -> ("lib/" + fatJar.getName)) - } + }, + scriptClasspath := Seq((assembly / assemblyJarName).value) ) lazy val storageAssemblySettings = Seq( + assembly / assemblyJarName := "nexus-storage.jar", assembly / test := {}, - assembly / assemblyOutputPath := baseDirectory.value / "nexus-storage.jar", assembly / assemblyMergeStrategy := { case PathList("org", "apache", "commons", "logging", xs @ _*) => MergeStrategy.last case PathList("org", "apache", "commons", "codec", xs @ _*) => MergeStrategy.last