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 achieve dependency Global exclusion of maven by Spring boot

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "how to achieve the global exclusion of dependency in maven by Spring boot". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to achieve the global exclusion of dependency for maven by Spring boot".

Scene

In Spring boot2.x, logback or spring-boot-starter-logging is used as the log implementation framework by default. If you want to use spring-boot-starter-log4j2, you can do the following

Org.springframework.boot spring-boot-starter-log4j2

If the two coexist, there will be a series of problems such as SLF4J: Class path contains multiple SLF4J bindings.

Will cause the application log file not to be generated

Solve the problem

It is a bit tedious and not very elegant to exclude every place it is used, and it is not recommended to use it.

Global exclusion of spring-boot-starter-logging is recommended. In maven, do the following:

Org.springframework.boot spring-boot-starter-logging * * org.springframework.boot spring-boot-starter-log4j2

At this point, I believe you have a deeper understanding of "Spring boot how to achieve the global exclusion of maven dependency". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Internet Technology

Wechat

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

12
Report