简体   繁体   中英

IntelliJ runs old version of tests and will not compile

In the past there has been no issue updating a test and run it in IntelliJ. Now, even after a File->Invalidate Caches->Invalidate and Restart an older version of the test runs.

Running mvn clean compile before rerunning the tests in IntelliJ resolves the issue ( mvn clean test also works as expected). An attempt to compile the project in IntelliJ results in a java: package com.shared does not exist . This is strange the project builds fine in Maven and IntelliJ does not catch any compile time errors with imports.

Could the error be related to the multi module project I recently created in Maven?

File->Invalidate Caches->Invalidate and Restart 

is not enough. Here are the steps to fix:

  1. Delete.idea folder
  2. File -> Close Project
  3. Reopen the Project

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