The basic element of POM. XML, which is used to manage project dependencies on third-party packages. Maven downloads the dependencies of some packages defined in this element to the local repository and allows the project to use them. Ensure that our project can be correctly built and deployed. Dependencies has a dependency element that specifies a package on which the project depends.
Dependency element description
Groupid, artifactid, version: groupid, artifactid, version of the referenced package
Type: Specifies the dependent project type, whether it is a jar package or another type package. The default value is jar.
Optional: If you only want to compile this project, or you do not need this package at runtime, you can set optional to true. If another project references this project, this package will not be dependent.
Classifier: used to differentiate JDK versions. Some packages use different JDK versions and have different suffixes for selection. We can add this classifier. Example: bouncycastle/bcprov-jdk15/135/bcprov-jdk15-135.jar
Systempath: used to specify the specific location of the package. This parameter is set when scope is set to system.
Scope: The scope of the dependency. SCOPE has the following values:
Compile, default value, applicable to all stages and will be released along with the project.
Provided, similar to compile, expects the container or user to provide this dependency.
Runtime, used only at runtime, such as the JDBC driver, applicable to the running and testing stages. This package is not used during compilation.
Test, which is only used for testing and is used to compile and run the test code. Will not be released along with the project.
System, similar to provided, must explicitly provide jar containing dependencies. MAVEN does not search for it in repository and will search for it in systempath. It will not be released along with the project.