A Maven dependency is loaded, expected types are present in the jar in .m2, yet IntelliJ paints the import in red.
I tried deleting the dependency directory and loading it again, it didn't help.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>dbftest</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>us_army</id>
<url>https://www.hec.usace.army.mil/nexus/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.xBaseJ</groupId>
<artifactId>xBaseJ</artifactId>
<version>20140212</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
import org.junit.jupiter.api.Test;
import org.xBaseJ.DBF; // in red
public class XBaseJTest {
@Test
public void testCompilation() {}
}
Interestingly, mvn test-compile does not fail.
Why?



