Maven - jar package depends range (scope tab)

  • the compile : The default value for all stages (development, testing, deployment, operation), the jar will always exist at all stages.

  • Provided : only in the development, testing stage use, purpose is to keep Servlet container and your local warehouse jar package conflicts, told the maven jar package on my server in the future there is, it does not need to be packaged in the project; the actual project package when, lib folder inside maven import provided package (jar package) are not. For compile, test the classpath are valid, but the run is invalid. As it has been provided by the container, e.g. servlet-api.

  • Runtime : only at runtime, such as JDBC driver for running and testing phase.

  • the Test : only when tests used to compile and run the test code. It will not be published with the project.

  • System :( Provided Similarly, providing a need to explicitly dependent jar, it does not find Maven) system-wide, and similar Provided in the Repository, but the scope of the need to explicitly specify dependencies jar package based on flag for the file system path. Because of the need to specify a local jar file path by systemPath, so the scope is not recommended. If the organization is based, and generally creates a local mirror, put a local organization or foundation components to join the local image management, avoid the use of the scope of the case.

----------------
This switched - link: https: //blog.csdn.net/qq_36761831/article/details/91039984

Guess you like

Origin www.cnblogs.com/must-grow/p/11936022.html