  We report supercurrent transport measurements in hybrid Josephson junctions
comprised of semiconducting InAs nanowires with epitaxial ferromagnetic
insulator EuS and superconducting Al coatings. The wires display a hysteretic
superconducting window close to the coercivity, away from zero external
magnetic field. Using a multi-interferometer setup, we measure the
current-phase relation of multiple magnetic junctions and find an abrupt switch
between $\pi$ and 0 phases within the superconducting window. We attribute the
0-$\pi$ transition to the discrete flipping of the EuS domains and provide a
qualitative theory showing that a sizable exchange field can polarize the
junction and lead to the supercurrent reversal. Both $0$ and $\pi$ phases can
be realized at zero external field by demagnetizing the wire.
