I did everything right with adding dependencies in pom.xml, but Intellij as smart IDE saw a vulnerability in querydsl dependencies. And I just clicked to ignore that vulnerability to remove enormous dependency highlighting. That is problem:)
It was ignored and not downloaded to External Libraries.
Btw I needed the querydsl-jpa dependency to be downloaded in External Libraries to properly import com.querydsl.jpa.impl.JPAQuery
I just deleted those dependencies, refreshed pom.xml, and added it again without ignoring them.
There is image of this thing: image with vulnerable dependency in Intellij