0

I added com.googlecode.libphonenumber to my POM file. I expected to be able to add it as required to the module-info file, but I couldn't. I can see in the .m2 directory. I can see it in the IntelliJ project .iml file.

I can see in the external dependency list along with all the other dependencies. Nothing seems wrong, yet I am not able to use the library in the project and IntelliJ suggests I import maven dependency (nothing happens, that was step 1). I tried to invalidate cache and restart. I tried deleting .idea and .iml file and re-importing the project. This is one of those times when I have nowhere to go but here. It just doesn't make sense.

krohit
  • 792
  • 1
  • 7
  • 26
nawf
  • 1
  • 2
  • There was a similar problem reported here: https://stackoverflow.com/questions/14866765/building-with-lomboks-slf4j-and-intellij-cannot-find-symbol-log/46934215#46934215 Do you have the lombok plugin installed? Sounds like that might fix your problem. – mohammedkhan Jun 28 '20 at 16:46
  • I had that looked at earlier. Did not really change anything. I am not using annotations anyway. – nawf Jun 28 '20 at 17:18

1 Answers1

0

requires libphonenumber; in module-info did the trick. IntelliJ was not suggesting this, I had to do it manually. Nor did it recommend it in a drop down list of possible dependencies. Java modules still need some refining.

nawf
  • 1
  • 2
  • When you start using the library and its dependency is already added to pom.xml, but not to the module.info, IntelliJ IDEA will highlight the usage and provide a fix to add "requires" directive to module.info – Olga Klisho Jun 29 '20 at 11:19