Maven doesn’t compile the project with jNativeHook from Github

I have added Jitpack repo and dependency from Github to pom.xml and it still doesn’t compile. However, when I point onto the line in import block, it clearly shows the description of a module.
VSCode screenshot

For example, I try to import com.github.kwhat.jnativehook.GlobalScreen, it shows the description of the module but still underlines the line with red and shows the error:

The type com.github.kwhat.jnativehook.GlobalScreen is not accessible Java(16778666)

What could be the problem?

Here’s a part of pom.xml




Moderation — A radically simple food diary and weight tracker

Chatting App in Flutter And Firebase