Mark Occurences for binary files in STS-Collection of common programming errors
This is complicated and it is not a maven or an STS bug. Rather, it is a Eclipse JDT bug. Mark occurrences cannot work unless the class file and all of its dependencies can be classloaded using the current project’s classpath. So, there must be some dependency that is missing for the class in question. It is probably available at runtime through maven, but just not at edit time.
It is very tricky to fix this problem, but you can start by explicitly adding all transitive dependencies to your pom.xml.