Maven scope attribute introduction

Detailed explanation of the attributes of scope:

     1.compile: The default value means that the dependent project needs to participate in the compilation of the current project, as well as subsequent tests, and the running cycle is also involved, which is a relatively strong dependency. It usually needs to be included when packaging.

     2.test: The dependent project only participates in test-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 participate in the compilation of the project, but it needs to be involved in the later test and run cycle. Compared with compile, it skips the compilation. For example, the JDBC driver is suitable for operation and testing phases.

     4.provided: You don't need to pack it when packing, other facilities will be provided. In fact, the dependency can theoretically participate in the compiling, testing, and running cycles. Equivalent to compile, but the exclude operation is done in the packaging phase.

    5.system: In terms of participation, it is the same as provided, but dependent items will not be downloaded from the maven repository, but taken from the local file system. The attribute of systemPath needs to be added to define the path.
 

Guess you like

Origin blog.csdn.net/qq_27828675/article/details/89000400