Junit5版本正确的导入方法,pom文件导入 如果没有使用maven就下载junit-jupiter聚合包

Failed to execute goal on project spring_ioc: Could not resolve dependencies for project org.example:spring_ioc:jar:1.0-SNAPSHOT: Failure to find junit:junit:jar:5.6.2 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [Help 1]
 

未在阿里云仓库找到junit对应的jar

是因为junit5版本使用的是聚合包  在pom文件中添加如下代码

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>5.6.2</version>
                <scope>test</scope>
            </dependency>

猜你喜欢

转载自blog.csdn.net/IT_laobai/article/details/108414771