002-Bug记录-Could not transfer artifact org.apache.maven.surefire:surefire-junit4:pom:2.12.4 from/to c


Maven项目,没有增加单元测试依赖前,可以打包安装

添加测试依赖后

    <dependencies>
        <dependency>
            <groupId>junitgroupId>
            <artifactId>junitartifactId>
            <version>4.12version>
            <scope>testscope>
        dependency>
    dependencies>

报错:Could not transfer artifact org.apache.maven.surefire:surefire-junit4:pom:2.12.4 from/to central

添加编译插件,刷新Maven,即可解决问题

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.pluginsgroupId>
                <artifactId>maven-surefire-pluginartifactId>
                <configuration>
                    <skipTests>trueskipTests>
                configuration>
            plugin>
        plugins>
    build>