0
votes

I have tried to add below in pom.xml

<scope>system</scope>
<systemPath>${project.basedir}/lib/example-lib.jar</systemPath>

but didn't work.

More information that I found :

It might be related to spring boot maven plugin. https://docs.spring.io/spring-boot/docs/current/maven-plugin/ which it not included scope "system" lib when building jar.

Ref : https://github.com/spring-projects/spring-boot/blob/master/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LibraryScope.java

Thank you in advanced.

1
hold on.. I might be related to spring boot maven plugin. docs.spring.io/spring-boot/docs/current/maven-plugin which it not included scope "system" lib when building jar. Ref : github.com/spring-projects/spring-boot/blob/master/…korrawit
system scoped dependencies are never added to packaged artifacts, that's why system scope is kind of evil and should really be avoided in mavenA_Di-Matteo

1 Answers

0
votes

I would suggest you to install the file to your local repo using below command. rather than using system path(as it would be difficult to manage paths when there are multiple developers(with more complexities with different OS))

mvn install:install-file -Dfile=<your jar file location\file name>.jar -DgroupId=com.kp<groupId> -DartifactId={your custom artifactId} -Dversion={version} -Dpackaging=jar

I use the above approach to use oracle's ojdbc.jar which is not part of Maven Repo.