Idea not update jar cache correctly in maven local repo?
Answered
for example I have 2 maven projects A, B
A was installed into maven local repo(A-1.0.0.jar) and B depends on it
now A is changed and re-installed - class Foo modifed and new class Bar added, Foo imports Bar
when open project B in idea and navigate to class Foo, I can see it's updated, but idea reports 'cannot resolve symbol Bar '
I checked 'External Libraries' in project panel and found there is no class Bar in library 'Maven: A:1.0.0' (A-1.0.0.jar), but there is actually a Bar.class in the jar file(otherwise project A wouldn't be compiled successfully)
I tried to reimport maven project, invalid caches and restart, but the problem still
Please sign in to leave a comment.
Use SNAPSHOT dependencies or bump up the version when you update Maven packages so that IDE can detect the change in version and fetch the new dependency.
You may also want to enable Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Always update snapshots option when using SNAPSHOT dependencies.
See https://www.tutorialspoint.com/maven/maven_snapshots.htm.
there's no way to manually reload it?
Rainmanhhh as suggested by Serge: use dependencies of the 'SNAPSHOT' version and the mentioned option enabled - then they will always be updated on Maven Reload.
SNAPSHOT version is specifically made for such cases.