I must admit that I've never worked on a dull and uninteresting project, so I'm not sure that I understand your question. And I develop enterprise systems for a living. :) Seriously, in practice I've found that programmers are bothered by "boring" work much less than I expected. Useless work, like filling out timesheets which nobody ever checks is much bigger problem. That being said:
Know your programmers preferences; some programmers don't like GUI, some steer away from SQL. Try to respect that preferences, since a task that's boring to one programmer might be fun to another. If it's not possible to divide the work in such a way for any reason, make it interesting by increasing competition - let them compete who'll be the first to finish his part, or make a scoreboard on whose part of code had the least amount of bugs in QA. Microsoft is known for their corporate culture which makes programmers compete on different approaches, and choosing the best one in the end or incorporating the best parts of each approach in the final product.
Owning a part of product and having control over it also drastically increases one's engagement. In contrast, there's nothing more boring than having someone micromanage your work. Also, if there's a recurring task everybody hates, explaining the bigger picture - that it's something that has to be done and why and rotating the person that does it each week is usually more than enough.