This article studies a $2\times 2$ hyperbolic system of conservation laws with general source term whose Riemann problem is solved with the use of the variable substitution. Four kinds of solutions involving delta-shock (delta standing wave) are constructed. We clarify the generalized Rankine-Hugoniot relation and entropy condition which are used to determine the position, propagation speed and strength of the delta-shock. The solutions are non-self-similar under the influence of source term. Compared with the homogeneous case, only the strength of delta-shock has changed, while the position and propagation speed of the delta-shock remain unchanged. Additionally, we propose a time-dependent viscous system to show the stability of the solutions including delta-shocks by adopting the vanishing viscosity method.