I'm trying to build a fat jar to use it in some other place.
I use maven assembly plugin
for that:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
Among my dependencies I have a local jar dependency, which I can't refuse:
<dependency>
<groupId>com.example</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/my-jar.jar</systemPath>
</dependency>
But this jar is on included to the final fat jar which I create with mvn package
.
What is the best way to include my local jar to fat jar as a dependency?
UPD.
There are some related questions, but they do not answer the question completely:
add jar to the maven local repository before build
maven-assembly-plugin doesn't add dependencies with system scope