Maven cited the usage of dependency scope

com.xxx.xx.maven hello 1.2 compile

Today I will share with you a very useful knowledge point

In normal work, there is generally little attention to scope, because its default value is compile, which is the most used case.

Scope, as the name implies, means effective scope, similar to @Retention(RetentionPolicy.RUNTIME) in custom annotations

Figure one
Here are a few possible values

test: Only in the life cycle mvn test will take effect, such as: Junit4.0.jar

provided: Does not take effect when deployed, such as: servlet.api.jar

Guess you like

Origin blog.csdn.net/weixin_42541360/article/details/88311643