This is a relationship question, so those of us who don't know you or your management personally can only give general suggestions.
I have had one boss who had the kind of relationship where he wanted to know if I was looking, and even asked how my interview went before I ultimately left. He also took my request for a raise up with the VP, and told me honestly that I probably wouldn't get it, because (during the recession) the top management thought we should just be grateful to have a job.
If you have an honest trusting relationship, you might even be able to work something out where you agree to stay through the end of the project, or long enough to bring your replacement up to speed, or agree to work a few hours a week as a contractor after you leave...
Sadly, many companies and many managers are not that way. The advice to keep it to yourself is probably the best advice if you don't completely trust them. You may look for a long time before you find what you want, or even ultimately decide to stay where you are.
My last piece of advice is to put your personal integrity first (Yes, even if it costs you your job). If you feel like you are being pushed to make commitments that you feel are not quite honest, find a way to make things right. You will be glad you did in the long run.