参考
https://yq.aliyun.com/articles/679578?spm=a2c4e.11163080.searchblog.180.54952ec100XbSa
I found that there is an easy solution for this problem. You can add a <Class-Path>
element to <manifestEntries>
element, and set <addClassPath>true</addClassPath>
to <manifest>
element. So value of <Class-Path>
element is added to class-path automatically. Example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addClasspath>true</addClasspath>
<mainClass>your.main.Class</mainClass>
</manifest>
<manifestEntries>
<Class-Path>../conf/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>