Skip to content

Commit

Permalink
Feat : Replace Maven Shade plugin with Spring Boot Maven plugin for u…
Browse files Browse the repository at this point in the history
…ber-jar creation

- Feat pom.xml toMsi.bat :
  - Removed configuration for maven-shade-plugin
  - Added spring-boot-maven-plugin with configuration for mainClass and JVM arguments
-Feat application.properties : Enable virtual threads support in Spring configuration
-Docs README : Replace build dependency
maven-shade-plugin by spring-boot-maven-plugin
  • Loading branch information
Lob2018 committed Oct 29, 2024
1 parent e720e22 commit 0076db0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .myresources/cmd/toMsi.bat
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
echo.
echo # OUTPUT : CREATING THE MSI...
cd ../
jpackage --input ./target --dest output --name %1 --type msi --main-jar %jarName% --main-class %4 --win-shortcut --win-menu --win-menu-group %1 --java-options "-Xmx2048m -Dapp.name=%1 -Dapp.version=%2" --vendor %3 --copyright "Copyright © %year% %3" --icon src/main/resources/fr/softsf/sudofx2024/images/icon.ico --app-version %2 --description "%1 %year%" --license-file LICENSE.txt --verbose
jpackage --input ./target --dest output --name %1 --type msi --main-jar %jarName% --main-class org.springframework.boot.loader.launch.JarLauncher --win-shortcut --win-menu --win-menu-group %1 --java-options "-Xmx2048m -Dapp.name=%1 -Dapp.version=%2" --vendor %3 --copyright "Copyright © %year% %3" --icon src/main/resources/fr/softsf/sudofx2024/images/icon.ico --app-version %2 --description "%1 %year%" --license-file LICENSE.txt --verbose
echo.
echo # TARGET : THE BATCH TO LAUNCH THE UBERJAR
cd ./target
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ application allows you to solve the current Sudoku grid, but also other entries
- Build dependencies :
- maven-compiler-plugin
- javafx-maven-plugin
- maven-shade-plugin (create the uber JAR)
- spring-boot-maven-plugin (create the uber JAR)
- exec-maven-plugin (batch to generate MSI and uber JAR with his run batch)
- Test dependencies :
- spring boot starter test (JUnit, Mockito, Hamcrest)
Expand Down
29 changes: 10 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
<maven.compiler.version>3.13.0</maven.compiler.version>
<passay.version>1.6.4</passay.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shade.version>3.5.2</shade.version>
<start-class>fr.softsf.sudofx2024.Launcher</start-class>
<surefire.version>3.2.5</surefire.version>
<testfx.version>4.0.17</testfx.version>
<start-class>fr.softsf.sudofx2024.Launcher</start-class>
</properties>
<!-- Project dependencies -->
<dependencies>
Expand Down Expand Up @@ -149,29 +148,21 @@
</options>
</configuration>
</plugin>
<!-- Shade plugin for creating the uber-jar -->
<!-- Spring Boot Maven Plugin for uberjar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${shade.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<mainClass>${start-class}</mainClass>
<jvmArguments>
<jvmArgument>-Dapp.name=${project.artifactId}</jvmArgument>
<jvmArgument>-Dapp.version=${project.version}</jvmArgument>
</jvmArguments>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spring.datasource.hikari.maximum-pool-size=2
spring.datasource.hikari.minimum-idle=1

# Virtual threads
spring.threads.virtual.enabled=false
spring.threads.virtual.enabled=true

0 comments on commit 0076db0

Please sign in to comment.