0

I am developing a software using Spring Framework. I use some external libraries and add them to the jar by declaring them in the pom.xml file as system scope dependencies.

When spring-boot-maven-plugin add them into the executable jar, it changes the libraries' original names. It actually adds the version info at the end of the file names.

For example;

Original name: gdal.jar Name in executable jar: gdal-1.0.jar

I don't want the spring-boot-maven-plugin to add version info to the file name.

Could you please help me with this issue?

Sincerely,

  • It's a very simple change in the pom. Just check the answer(s) of the duplicate question – Stultuske Nov 27 '19 at 07:57
  • Actually, none of the answers solves my issue. My problem is not about adjusting final jar file's name. It is okay. When I open the final jar file with archive manager, there is a folder in the archive in BOOT-INF/lib directory. There are some of my external libraries and their names are changed by adding the version info. However, original libraries do not have version info at the end of their names. – Ahmet Yakar Nov 27 '19 at 08:18
  • This question isn't a duplicate. The other question is about controlling the final name of the artifact, this is about the included jars of system scope. – M. Deinum Nov 27 '19 at 08:20
  • 1
    and how do you verify the original jars don't have the version in their name? maven goes download the jars from a repository, to my knowledge, it doesn't change their names. – Stultuske Nov 27 '19 at 08:21
  • The point is maven does not download these libraries. They are external libraries which are located directly in my computer's storage. I point them as system scope libraries to the Maven. – Ahmet Yakar Nov 27 '19 at 08:23
  • What is the reason that you don't want the version numbers? As those jars are "hidden" in the fat jar, does it really matter? – Wim Deblauwe Nov 27 '19 at 08:30
  • Because one of the modules in the fat jar file reaches those libraries directly with their original file names like "gdal.jar" not "gdal-1.0.jar". Due to this situation it cannot find the required libraries for itself. – Ahmet Yakar Nov 27 '19 at 08:34
  • why would it do that? I would expect a dependency by groupId and artifactId to be in place ... that doesn't look at filename. – Stultuske Nov 27 '19 at 08:39
  • Let's get through with "gdal.jar" example. I have this file on my storage in some path. Let's say it is in "/opt/gdal.jar". I add this dependency in my pom.xml file like a normal dependency except I give the groupId and artifactId and also I provide a /opt/gdal.jar and system. Also I have to give a version(let's say 1.0) into for this dependency because it is a must for maven build. On the other hand, a different library in my fat jar looks for "gdal.jar" in the fat jar but it is not "gdal.jar" anymore. It is "gdal-1.0.jar". – Ahmet Yakar Nov 27 '19 at 08:47

0 Answers0