How to add local module dependencies in Springboot
This article introduces the knowledge of "how to add local module dependency in Springboot". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Add local module dependencies
This has really bothered me for several days, and today I finally tested OK.
First of all, you need to add the dependency of the local module to pom.
Com.example module_one 0.0.1-SNAPSHOT
After it is added here, it still doesn't work. You still need to add module dependencies, as shown below:
*! Both must be added together!
It doesn't work to add any one, it will fail.
And then OK.
Reference an external jar package when packaging
Springboot projects are basically packaged with maven dependencies, but sometimes the jar packages used cannot be downloaded from maven and can only be placed under the local lib folder. In this case, local configuration needs to be introduced into the pom.xml file.
1. Add the local dependency com.kingbase8 kingbase8 8.2.0 system ${project.basedir} / lib/kingbase8-8.2.0.jar2, and add the node ${project.basedir} / lib BOOT-INF/lib/ * * / .jar src/main/resources 3 to the packaging plug-in of pom.xml. If local jar packages are added to the lib folder in multiple sub-projects
You need to add additional configuration nodes to the packaging plug-in of pom.xml, otherwise the local jar of other sub-projects cannot be added to the jar when packaging.
Org.springframework.boot spring-boot-maven-plugin true
There are many ways to quote an external jar, and this is just one of them. My current project is multiple sub-projects, and I solved the problem in this way, so I wrote it down.
This is the end of "how to add local module dependencies in Springboot". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!