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 solve the problem of compiling errors by referencing dependency in pom

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

Share

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

This article introduces the relevant knowledge of "how to solve errors in pom citation dependent compilation". 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!

Solution:

1 pay attention to introducing dependent scope configuration

Org.jmockit

Jmockit

1.44

Test

The scope here is test, which doesn't work at compile time, by the way, recall the scope of scope.

Scope:

1.compile: the default value indicates that the dependent project needs to participate in the compilation of the current project, as well as subsequent tests, and the run cycle is also involved, which is a strong dependency. When packing, it usually needs to be included.

2.test: dependent projects only participate in testing-related work, including the compilation and execution of test code, and will not be packaged, such as junit

3.runtime: indicates that the dependent project does not need to be involved in the compilation of the project, but it is required for later testing and run cycles. Compared to compile, it just skips compilation. For example, JDBC driver, suitable for run and test phases

4.provided: you don't have to pack it when you pack it. Other facilities will provide it. In fact, the dependency can theoretically participate in compilation, testing, running, and other cycles. It's equivalent to compile, but exclude is done in the packaging phase.

5.system: in terms of participation, it is the same as provided, but the dependencies are not downloaded from the maven repository, but are taken from the local file system. You need to add attributes of systemPath to define the path

This is the end of the content of "how to solve errors in pom depending on compilation". Thank you for your 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

Internet Technology

Wechat

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

12
Report