If you're using cash accounting (which you are; you'd have to elect accrual, and that would come after a long discussion with your accountant) you include income when it's received and you take deductions when they occur. So, yes, you pay 2017 taxes on the money you received in 2017. And you deduct expenses for that project when you pay for them.
With cash accounting, tax liabilities don't correspond to your notion of what a project is. They're purely calendar-based. So overall your project earns you a fee and you pay expenses, and that's important for understanding how well your business is doing. But for tax purposes, there's no inherent connection between them; income comes in when it comes in, and expenses are paid when they are paid. Taxes are due each year, so you'll have a big tax bill for 2017 and lots of deductions for 2018, 2019, and as long as the project lasts.
If you were using accrual, you'd count income when it was earned, regardless of when you actually received it, and you'd count expenses when they became due, regardless of when you actually paid them. That makes your tax bill more closely match your view of what each project is doing. But that's more complicated, and often not worth the extra effort.