依赖分为四种
- compile
- test
- runtime
- provided | scope | 说明 | 示例 | | :—- | :—- | :—- | | compile | 编译时需要用到该jar包(默认) | commons-logging | | test | 编译Test时需要用到该jar包,正常运行时不需要 | junit | | runtime | 编译时不需要,但运行时需要用到 | mysql | | provided | 编译时需要用到,但运行时由JDK或某个服务器提供 | servlet-api |
写的时候:
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>5.3.2</version><scope>test</scope></dependency>
maven 仓库好像会慢, 配镜像在user/.m2/settings.xml里
