We consider the long term portfolio management problem, under stochastic rates and inflation risk. Five basic financial assets are considered: a money market account (the cash), an inflation-protected cash, a financial stock index and two different bonds with constant maturity. The first one corresponds to a nominal bond while the second one is an inflation-indexed bond. We consider constant maturation bonds, which allows to obtain a bond/stock ratio increasing with time (when there exists no inflation). This nice property is in accordance with popular advice. In this framework, we provide the general solution of the expected utility maximization. This intertemporal optimization problem is solved by using the martingale approach. We detail in particular the CRRA case. We determine also the optimal portfolio weights and analyze the solutions. We show in particular that the weight invested on the inflationindexed bond increases with the relative risk aversion and also when the time horizon increases, which corresponds to a stronger demand for inflation hedging for longer We gratefully acknowledge participants at the 4th International Symposium in Computational Economics and Finance (ISCEF), (April, 14-16, 2016, Paris), for their helpful comments and suggestions.