From 01bf94c60af47da275af5455901c818f0cbf91bc Mon Sep 17 00:00:00 2001 From: anthorob Date: Sun, 18 Oct 2026 02:10:38 -0400 Subject: [PATCH] Switch to `maven-dependency-plugin` and adjust build output Replaced `maven-shade-plugin` with `maven-dependency-plugin` for dependency management, simplifying the build process and separating runtime dependencies into a dedicated `lib/` directory. Updated `Dockerfile` and GitHub Actions config to account for these changes, ensuring all dependencies are correctly packaged and deployed. --- .github/workflows/ci.yml | 1 + Dockerfile | 1 + pom.xml | 55 +++++++++------------------------------- 3 files changed, 14 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3854d04..0d4f69f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: name: maven-artifacts path: | target/netneutrality.jar + target/lib startup.sh if-no-files-found: error diff --git a/Dockerfile b/Dockerfile index 94764e2..75afa3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ ARG API_PORT=9000 EXPOSE ${API_PORT} COPY startup.sh ./ +COPY --from=build /build/target/lib ./lib COPY --from=build /build/target/netneutrality.jar ./ RUN ["chmod", "+x", "./startup.sh"] diff --git a/pom.xml b/pom.xml index 1d1a36f..5a63573 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,4 @@ - + @@ -87,9 +87,12 @@ maven-jar-plugin 3.5.0 + netneutrality ${main.class} + true + lib/ @@ -97,52 +100,18 @@ org.apache.maven.plugins - maven-shade-plugin - 3.6.2 + maven-dependency-plugin + 3.8.1 - package + copy-libs + prepare-package - shade + copy-dependencies - netneutrality - - - *:* - - module-info.class - META-INF/versions/*/module-info.class - META-INF/MANIFEST.MF - META-INF/LICENSE* - META-INF/NOTICE* - META-INF/DEPENDENCIES - META-INF/jandex.idx - META-INF/versions/9/OSGI-INF/MANIFEST.MF - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - com.squareup.okhttp3:okhttp - - ** - - - - - - ${main.class} - - - - - true - - - - false + ${project.build.directory}/lib + runtime @@ -350,4 +319,4 @@ - \ No newline at end of file +