1

If my application(main app) use external jars(libs) that use external jars(libs), I need to copy dependency, so I would like to know how it works behind the scene?

Second, is it possible to have application that uses ServiceLoader to import extensions, whice inside themself call ServiceLoader? Right now I make application that imports extensions with ServiceLoader, and that works fine with module paths, but if my extensions also have ServiceLoader, where I'm setting their module path if that is even possible?

John
  • 49
  • 1
  • 9
  • 1
    Use maven and let it be done for you – Antoniossss Jun 17 '19 at 23:33
  • @Antoniossss Currently I'm going through some tutorial on maven, but it came to me one thing. Does any change of libraries demands main application update? What I'm trying to do, is just to send new module, and main application would read it dynamically without any changes(update). – John Jun 25 '19 at 08:58
  • Depends on packaging. If you wont build Uber jar thatn all libs will be lets say in `lib` directory when you will be able to replace jars without rebuilding the application. – Antoniossss Jun 25 '19 at 09:04
  • @Antoniossss I don't mean to replace jars, I'm planning to add new without updating main application. And if maven requires goupid, artifactid and version in pom file for every dependencies, then it is impossible to dynamically add new modules without updating main application. Did I miss something? – John Jun 25 '19 at 09:18
  • Maven is a build tool, not running platform. You want dynamic class loading (probably). – Antoniossss Jun 25 '19 at 09:39
  • @Antoniossss I know, but when I describe what I want to achieve, everyone suggest to use Maven without understanding way of execution. Maven handles dependencies nicely but it isn't dynamically as I want. – John Jun 25 '19 at 09:45

0 Answers0