Intellij - Maven's pom.xml doesn't suggest(autocomplete) when injecting dependency

Answered

I'm new to Intellij IDEA. I have a small error when dealing with pom.xml file. It seems that Intellij only find and suggest(autocomplete) when i inject a dependency comes from local repository. If I inject any other dependencies that not is not provided in the local repo but from remote repo ( for example in my spring boot web project, apart from dependencies like JPA, Spring Web, Thymeleaf, I want to inject org.webjars:bootstrap:4.1.3 for bootstrap), pom.xml does't suggest the dependency for me. If I force to type the dependency, it raise the compile error: Dependency 'org.webjars:bootstrap:4.1.3 for bootstrap' not found. There won't be any problem if i rebuild the maven( mvn clean install ), but it takes effects only with downloaded jars. I wonder if there are any ways intellij pom.xml can suggest for me and not raise any compile error. Thanks, everybody and wish all of you a nice day

0
1 comment

IDE suggests dependencies, based on the indexed Maven repositories. For remote repositories it means that IDE downloads the remote repository's index and uses it for completion. You can try updating repositories in Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Repositories settings.

0

Please sign in to leave a comment.