Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add local module dependencies in Springboot

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report