Skip to content

Commit

Permalink
Merge pull request #102 from CDOT-CV/fix/reduce-publish-jar-size
Browse files Browse the repository at this point in the history
Remove Sping Dependencies from Maven Jars
  • Loading branch information
drewjj authored Sep 23, 2024
2 parents 2917a57 + a2c30c6 commit 0f66b7d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/artifact-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
run: mvn versions:set -DremoveSnapshot

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B clean package --file pom.xml -DskipTests -Ppackage-jar

- name: Publish to GitHub Packages
run: mvn --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy
run: mvn --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy -DskipTests -Ppackage-jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions jpo-ode-svcs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,38 @@
</plugin>
</plugins>
</build>
<!-- profile to output only source code and not include any spring boot dependencies in published jar -->
<profiles>
<profile>
<id>package-jar</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>us.dot.its.jpo.ode.OdeSvcsApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 0f66b7d

Please sign in to comment.