21

As shown in following screenshot a maven library is marked as red - even though it does exist in local maven repo

/Users/steve/.m2/repository/com/typesafe/akka/akka-remote_2.10/2.2.3/akka-remote_2.10-2.2.3.jar

enter image description here

But that file does exist on the local filesystem: Here it is on the local file system

21:43:12/scaladem:35 $ls -l /Users/steve/.m2/repository/com/typesafe/akka/akka-remote_2.10/2.2.3/akka-remote_2.10-2.2.3.jar
-rw-r--r--  1 steve  staff  1277288 Feb 21 21:42 /Users/steve/.m2/repository/com/typesafe/akka/akka-remote_2.10/2.2.3/akka-remote_2.10-2.2.3.jar

Here are maven entries in pom.xml

    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-actor_2.10</artifactId>
        <version>2.2.3</version>
    </dependency>
    <dependency>
        <groupId>com.typesafe.akka</groupId>
        <artifactId>akka-remote_2.10</artifactId>
        <version>2.2.3</version>
    </dependency>

Note also:

mvn package

works fine from the command line

0

4 Answers 4

13

Intellij IDEA - File - Invalidate Caches / Restart..

This worked for me.

3

It just happened to me. Re-import didn't work. I solved it by

  1. Remove your dependency from the POM
  2. Save the POM (assume you have "Enable Auto-Import", if not, check "Import Maven projects automatically" from settings)
  3. Add the dependency back

It is basically re-import, but it does the magic for me. Good luck.

1
  • thanks it solved problem on my IDEA, when I checked project structure>libraries, all red underline and if u put mouse on them, there is a notification, 'libraries invalid classes root'. Sep 16, 2021 at 6:47
3

You should also try mvn install from the command-line, or install from the Maven Projects sidebar.

2

If it works from command line, a reimport should work (Right Click on project -> Maven -> Reimport).

1
  • 1
    Thanks, I had performed re-import a number of times before posting this. May 2, 2014 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.