Skip to content

Commit

Permalink
ServiceLoader seems to not work good with a fat-jar. Build a slim jar…
Browse files Browse the repository at this point in the history
… instead and add dependency-jars to classpath
  • Loading branch information
davidkleiven committed Oct 2, 2023
1 parent b87560f commit 92dfc2c
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,31 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${main.class}</mainClass>
<classpathPrefix>dependency-jars/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>make-assembly</id>
<id>copy-dependencies</id>
<phase>package</phase>
<goals> <goal>single</goal> </goals>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 92dfc2c

Please sign in to comment.