The tensor force is implemented into the mean-field model so that the evolution of nuclear shells can be described for exotic nuclei as well as stable ones. Besides the tensor-force part simulating the meson exchange, the model is an extension of the successful Gogny model. One of the major issues of rare-isotope beam physics is a reduced spin-orbit splitting in neutron-rich exotic nuclei. It will be shown that the effect of the tensor force on this splitting is larger than or about equal to the one due to the neutron skin. We will present predictions for stable and exotic nuclei with comparisons to conventional results and experimental data.