简体   繁体   中英

IntelliJ Idea - No files were downloaded for junit:junit:5.0-SNAPSHOT

Have little exposure to Maven and other external libraries. Junit worked fine just a week ago, possibly affected by an update? Can't be sure, same error happens when attempting to install other versions.

10:08 pm Repository library synchronization: No files were downloaded for junit:junit:5.0-SNAPSHOT

Again, it worked just fine a week ago, here are the tests - https://github.com/Ry4nW/CS-11-VLN/blob/main/CS%2011%20VLN/IntegerSetTest/TestCases/IntegerSetTests.java

You configured your dependency wrong. According to your test you're using JUnit 4. Your dependency should be

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit<artifactId>
    <version>4.13.2</version>
    <scope>test</scope>
</dependency>

There is no version 5.x of junit:junit. JUnit 5 uses different group and artifact IDs. Eg

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.7.1</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.7.1</version>
    <scope>test</scope>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM