When it comes to the demonstration of the gauge-invariance of the Lagrangian of the Maxwell-theory Srednicki's book proceeds as follows:
$${\cal L} = -\frac{1}{4}F^{\mu\nu}F_{\mu\nu} + J^\mu A_{\mu} \tag{54.21}$$
I am interested in the second term $J^\mu A_\mu$. Under a gauge transformation the 4-vector potential transforms as $A'_\mu =A_{\mu} - \partial_\mu \Gamma$ In order to show gauge invariance one has to show that
$$J^\mu ( A'_{\mu} - A_{\mu}) = -J^\mu \partial_\mu \Gamma = (\partial_\mu J^\mu)\Gamma -\partial_\mu(J^\mu \Gamma)$$
can be "neglected". The argumentation of Srednicki is that the second term can be neglected since upon considering the action the corresponding integral over $d^4x$ vanishes and the first term disappears because of current conversation. The latter, however, would mean that the Lagrangian is only gauge-invariant for the $A_\mu$-field configuration that fulfills the Maxwell-equations, otherwise the current would be not conserved. Is the Maxwell-Lagrangian (54.21), in particular the coupling term, gauge-invariant for all field configuration or only for the special one that fulfills the field-equations?
In particular in view of the comments given to the post Is the Dirac Lagrangian locally gauge invariant without gauge field $A$? I am confused.
EDIT Actually, I don't know if a background current would automatically fulfill the equation $\partial_\mu J^\mu=0$, but at least if the Maxwell-equations are fulfilled, i.e. $\partial_\nu F^{\mu\nu} = J^\mu$ by taking a second derivative we get: $0=\partial_\mu\partial_\nu F^{\mu\nu}= \partial_\mu J^{\mu}$. So from this perspective the current conservation seems to a result of the Maxwell-equations. And this is what Srednicki mentions the page that just precedes that of expression (54.21). That suggests strongly that the current conservation only is valid if the Maxwell-equations are fulfilled.