0

I have a spring boot application with maven.

I need to use an external jar say "tp.jar". I have used the method of system scope to do the same but seems it has been deprecated. Is there any better alternative which doesn't involve running maven commands to do the same. I found some solutions here Can I add jars to maven 2 build classpath without installing them?

But the posts are pretty old was wondering if any new solution and convenient solution has been found.

Manas Saxena
  • 2,171
  • 6
  • 39
  • 58
  • 1
    You can try that and see if it works... – Andreas Jul 11 '19 at 08:31
  • Is this jar a dependency of your application? – khmarbaise Jul 11 '19 at 13:22
  • @khmarbaise yes i have kept it in src/main/resources – Manas Saxena Jul 11 '19 at 16:56
  • @Andreas yes they work but with the overhead of either installing the jar using maven commands or creating repository in my project. The solution should be as simple as adding a dependency with relative classpath, that is what I am looking for. – Manas Saxena Jul 11 '19 at 16:58
  • You have a dependency jar file in `src/main/resources`? Does not make sense. Do you use a repository manager? Is this an open source project or a corporate project? If it is an open source project please add the link to the project?.. – khmarbaise Jul 11 '19 at 17:18
  • @khmarbaise It is not open source, why doesn't it make sense to have jar in src/main/resources? Where should ideally the jar be? – Manas Saxena Jul 11 '19 at 17:31
  • 1
    You should use a repository manager and consume it from there..That's best and most convenient way to handle all dependencies.. – khmarbaise Jul 11 '19 at 18:27

1 Answers1

0

If you are in a company doing Java, you probably have a Nexus or Artifactory server running. This is the place to put the jar. Then you can use all Maven mechanisms to use it.

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