I\'m trying to use the barbecue barcode printing library. I have successfully added the library to IntelliJ through project structure add library. Then I imported the packa
In my case the problem was that there was a different repository directory configuration in IntelliJ and in settings.xml file.
Check both repository directories are the same:
IntelliJ (File
> Settings
> Build,Execution,Deployment
> Build Tools
> Maven
)
settings.xml
(usually in C:\Users\myuser\.m2
or /home/myuser/.m2
)
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<localRepository>C:\Users\myuser\.m2\repository</localRepository>
...
</settings>
After fixing directories run:
In my case the only thing that worked is:
mvn idea:idea
The good thing is that you don't have to delete .idea folder or .iml files and loose all configuration. Everything will be preserved.
(Possibly something like gradle idea
works for gradle too).
Quit IntelliJ, remove every .idea
directory:
rm -Rf **/.idea/
and restart.
menu -> build -> Rebuild Project
has worked for me
(Invalidating caches without this step doesn't help)
I tried
in different combinations.
But going from Intellij 2020 version to 2019 solved my issue.
If you added a library to the project structure (rather than via maven, that would be different), be sure it is included as a dependency for the relevant module.
Project Structure -> Modules -> Dependencies