  Within a hadronic transport model we study in detail contributions to kaon
yields and momentum spectra from various baryon (resonance)-baryon (resonance)
and $\pi N$ interactions in heavy-ion collisions at beam energies near the
free-space kaon production threshold. It is found that the finite lifetime of
baryon resonances affects significantly the shape of kaon spectra, and the high
energy parts of the kaon spectra are dominated by kaons from $\pi N\rightarrow
\Lambda K^{+}$ processes. $N^{*}(1440)$ resonances are found to contribute
about 10\% to the kaon yield. Effects of boosting the Fermi momentum
distributions of the two colliding nuclei into their center of mass frame,
centrality of the reaction as well as the nuclear equation of state on kaon
yields and spectra are also discussed. Model calculations on $K^{+}$, $\pi^{+}$
and $\pi^{-}$ spectra for the reaction of Au+Au at $E_{beam}/A= 1.0$ GeV are
compared with the experimental data from the KaoS collaboration.
