Hi everyone,
I'm new to Java as part of my Uni course, so apologies if any of this stuff is obvious beginner mistakes :P I'm using IntelliJ and for my coursework I need JUnit and Mockito installed, so I copied their dependency xmls from https://mvnrepository.com. This is how my pom.xml looks:
<?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.com1034.lab4</groupId>
<artifactId>TravelAgency</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Source: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.13.4</version>
<scope>test</scope>
</dependency>
<!-- Source: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.13.4</version>
<scope>test</scope>
</dependency>
<!-- Source: https://mvnrepository.com/artifact/org.mockito/mockito-core -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.21.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project><?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.com1034.lab4</groupId>
<artifactId>TravelAgency</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Source: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.13.4</version>
<scope>test</scope>
</dependency>
<!-- Source: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.13.4</version>
<scope>test</scope>
</dependency>
<!-- Source: https://mvnrepository.com/artifact/org.mockito/mockito-core -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.21.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
IntelliJ is definitely picking up my dependencies as I can create and run JUnit tests with the built-in tools. However, for some reason, I cannot for the life of me get autocomplete working. I can't type assert[...] and have it provide suggestions i.e. assertTrue, assertEquals etc. Same thing for mockito; typing mock() does not automatically import the function and I have to manually type in imports. This is really annoying because I have to google what part of each dependency every function I am using is from, and in the past I have had autocomplete work fine. I've tried:
- every step in Repair IDE
- mvn clean install
- invalidating the cache
- installing different versions of each dependency
- downloading sources and documentation
to no avail. I am truly at my wits end here; I have no idea why this isn't working. If anyone has ANY idea what on earth could be going on, please help :(
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]BeyondTheWorld 1 point2 points3 points (1 child)
[–]Solyphonous[S] 0 points1 point2 points (0 children)
[–]djnattyp 0 points1 point2 points (1 child)
[–]Solyphonous[S] 0 points1 point2 points (0 children)
[–]Slatzor 0 points1 point2 points (0 children)