[RESOLVED] Sponge imports suddenly stopped working

I am just back from holiday and suddenly my sponge imports stopped working. Sponge is in my pom.xml and it shows org.spongepowered:spongeapi:2.1-SNAPSHOT in my dependency list.

But all my org.spongepowered.x imports turned red saying ¨Cannot resolve symbol ´spongepowered´ ¨. All dependencies of spongeapi like com.google.inject are available and I CAN import them. What may be the problem?

sponge api is not in project libraries.
ctrl alt shift s > modules > dependencies.

It is there but it is underlined with a red line.
It says the classes are not downloaded.

“C:\Users\p6340nl.m2\repository\org\spongepowered\spongeapi\2.1-SNAPSHOT\spongeapi-2.1-20150607.054745-101.jar” does indeed not exist, but spongeapi-2.1-SNAPSHOT.jar and spongeapi-2.1-20150720.190412-129.jar do exist. How can I make intellij select this jar?

EDIT: It also seems like there is a task active “Resolving maven dependencies…” but it is stuck for at least 10 minutes

I guess you can compile via maven but not with ide’s compile option right.

Settings > Maven > Importing
check Import Maven projects automatically
check Use Maven3 to import project
VM options for maven -Xmx512m

run clean install --update-snaphosts

is your intellij up to date? if not it might be a bug (your intellij looks like v12) https://youtrack.jetbrains.com/issue/IDEA-98425

I have intellij 14.1.14, as far as I know is that the newest version.
I use Maven3 to import and my import maven project automatically was already on. My vm option was already on -Xmx512m.

Using the command you say I get this error: Unable to parse command line options: Unrecognized option: --update-snaphosts

You are getting this error because i cant write without intellisence anymore… --update-snapshots

1 Like

Oh didn’t even see that myself haha.

The build finished with success but the problem didnt go away. (Weird because the error is still there?)

From some reason intellij is failing to include spongeapi into project dependencies

  • add it manually.
  • delete .idea folder, .iml file and create new project from existing sources.
1 Like

Deleting the .idea and .iml file and reimporting worked.
Thank you :smile: