简体   繁体   中英

Cannot find symbol after svn update

Sometimes, if the other developers change/add a bunch of classes in the system and when I click "update to the latest", I got lots of ".... cannot be resolved to a type" or ".... cannot be resolved".

In order to solve this problem, I am trying to update with dependencies with mvn dependency:resolve command and I update maven project(with force update). Sometimes, it helps.

When it does not help, I remove the whole local repository and making an update again. Sometimes, it helps also.

However, I know that what I am doing until now is just a brute force. I want to approach the problem more professionally.

What is the best approach when I get "cannot find symbol" error after "update project to head" with svn?

Although it is hard to tell the sure shot fix for your issue unless we happen to see more details. But to give you one hint,

just make sure that the Maven is reading the same Java version as what is declared in your pom.xml for the project where you face "cannot find symbol".

Also if you are using eclipse plugins m2e it better at times to run mentioned set of commands in place of maven clean install ,as eclipse loses track of the class files and thinks some of them are undefined.

As a solution you may use following command at the command line instead:

mvn eclipse:clean
mvn clean install
mvn eclipse:eclipse

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM