We report on direct measurements of the plasma oscillations in Josephson tunnel junctions of various spatial dimensions. The effect of the spatial variation of the Cooper-pair phase difference (the Josephson phase) on the dynamics of the junction was investigated by application of a static magnetic field threading the tunneling barrier. We compare measurements where the plasma frequency was tuned either by applying a magnetic field or by raising the temperature. A crossover from short- to long-junction behavior of the functional dependence of the plasma oscillations was observed in the case of an applied magnetic field. Numerical simulations of the governing partial-differential sine-Gordon equation were performed and compared to the experimental results and a perturbation analysis. The theoretical results support the experiments and allow us to interpret the observed crossover as due to the spatial variation of the Josephson phase.