0

I wanted to install add a new library. And I already added this dependency:

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-crypto</artifactId>
            <version>5.2.0.RELEASE</version>
        </dependency>

but I am not able to and I do not know why

enter image description here

i need it for that code:

String hashpwd = BCrypt.hashpw(benutzer.getPasswort(),BCrypt.gensalt());
benutzer.setPasswort(hashpwd);

but BCrypt is always red and if i hover over it there is written cannot resolve symbol

Anna F
  • 23
  • 9

1 Answers1

0

Have you tried re-importing the dependencies? You have to manually re-import the dependencies when the enable auto-import option is not enabled in IntelliJ.

The reimport button can be found in the Maven tab to the right in IntelliJ: enter image description here

Troley
  • 1,421
  • 1
  • 12
  • 14
  • I tried importing your dependency-setup and all went fine. I kind of fail at reproducing your problem. Have you, by any chance, come across this post which seemed to have a similar issue? https://stackoverflow.com/q/11454822/7804385 – Troley Nov 07 '19 at 22:38
  • could you tell me step by step what you did. maybe i missed something – Anna F Nov 07 '19 at 22:48
  • if i click at the .idea > libraries folder there are a lot which ones do you have there? – Anna F Nov 07 '19 at 22:50
  • Well I created a Maven test project which has one module named my-app, the same you see on the picture in my answer. I then entered each and every that is seen on your image of dependencies into the tag in the pom.xml file of the module. I have auto-import enabled, so the dependencies auto downloaded, but I also tried it without the auto-import and it worked fine as well. – Troley Nov 07 '19 at 22:58
  • ok thank you I also did all those steps and I really do not know why it does not work for me – Anna F Nov 07 '19 at 23:00
  • What I might suggest is Invalidating cache, menu File -> Invalidate Caches / Restart... That might do the trick – Troley Nov 07 '19 at 23:02
  • which version do you have – Anna F Nov 07 '19 at 23:04
  • I'm using IntelliJ IDEA Ultimate 2019.2.2 – Troley Nov 07 '19 at 23:06
  • Hm, maybe you can try to create another project, import the same dependencies in the new project and have a look at the differences between the `.iml` file folder of the mps-rest project and the new project. – Troley Nov 07 '19 at 23:22
  • Have you checked idea.log ("Help | Show Log in...") for errors? – y.bedrov Nov 08 '19 at 10:33