依赖分为四种

    • compile
    • test
    • runtime
    • provided | scope | 说明 | 示例 | | :—- | :—- | :—- | | compile | 编译时需要用到该jar包(默认) | commons-logging | | test | 编译Test时需要用到该jar包,正常运行时不需要 | junit | | runtime | 编译时不需要,但运行时需要用到 | mysql | | provided | 编译时需要用到,但运行时由JDK或某个服务器提供 | servlet-api |

    写的时候:

    1. <dependency>
    2. <groupId>org.junit.jupiter</groupId>
    3. <artifactId>junit-jupiter-api</artifactId>
    4. <version>5.3.2</version>
    5. <scope>test</scope>
    6. </dependency>

    maven 仓库好像会慢, 配镜像在user/.m2/settings.xml里