1

3rd party jars are not in the repo, may be updated from time to time.

I use dependency in maven as

    <dependency>
        <scope>system</scope>
        <systemPath>$path/$name.jar</systemPath>
   </dependency>

to compile and the jars are not in the bundle which is as I wish.

When spring-boot jar is deployed on the target machine, how to run it?

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
yk42b
  • 179
  • 3
  • 15
  • Start to use a repository manager and avoid system scope dependencies. Apart from that If I correctly remember spring boot maven plugin does take them into account? – khmarbaise May 08 '18 at 07:33
  • using repo is not an option for this case since it has fixed path on deployed machine and are not managed in the repo – yk42b May 08 '18 at 07:40
  • Your systemPath is a path on the productive machine where you run your application (not a path on the build server)? – J Fabian Meier May 08 '18 at 07:53
  • systemPath is the path on the build machine. And unfortunately the path is different form the target machine – yk42b May 08 '18 at 07:56
  • As far as I know, `` entries are purely used for _building_ the artifact. The runtime classpath is an entirely different thing. You can not expect your application to "look up" a systemPath from the pom at runtime. – J Fabian Meier May 08 '18 at 07:59
  • That's the reason why I ask the question. – yk42b May 08 '18 at 08:05

2 Answers2

1

For including a jar from a path into your Spring boot classpath see

External library folder for Spring Boot.

This means that you can safely manage your dependency in your pom by a repo (avoiding sytemPath dependencies).

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0

With SpringBoot project using Maven build tool, you can use:

mvn install:install-file "-DgroupId=org.apache.poi" "-DartifactId=poi-ooxml" "-Dpackaging=jar" "-Dfile={your_path_to_jar_file}" "-Dversion=1.1.0"

Good luck,

Hungnn
  • 68
  • 1
  • 2
  • 19