In the Faddeev-Popov procedure of path integral of $$ Z[J] = \int [DA] e^{iS(A,J)}, \quad S(A,J)= \int d^4x [-\frac{1}{4}F^{a\mu\nu}F_{a\mu\nu} + J^{a\mu}A_{a\mu} ] $$ we have used that $S(A,J)$ is gauge invariant: $$ S(A,J) = S(A^U, J), \quad A^U_\mu(x) = U(x) A_\mu(x) U^\dagger (x) + \frac{i}{g} U(x) \partial_\mu U^\dagger (x) $$ But I cannot prove the above. The first term in $$ S(A,J)= \int d^4x [-\frac{1}{4} Tr[F^{\mu\nu}F_{\mu\nu}] + Tr[J^{\mu}A_{\mu}] ] $$ is of course gauge invariant and well known. But for the invariance of the second term, all textbooks I've read seems to ignore and state its invariance (eg. Srednicki chapter 71).
One possible way for proving this is mentioned in Srednicki chapter 71. We can compute the infinitesimal transformation (Srednicki 71.7) $$ A_\mu(x) \to A_\mu(x) - D^{adjoint}_\mu \theta(x) $$ where $D^{adjoint}_\mu$ is the covariant derivative on the adjoint bundle. And what I can imagine is to use the similar argument as Stokes's theorem: $$ \delta(Tr(J^\mu A_\mu)) = - Tr(J^\mu D^{ad}_\mu \theta(x)) = - D^{ad}_\mu (Tr(J^\mu \theta(x))) + Tr((D^{ad}_\mu J^\mu) \theta(x)) $$ So my question is:
Is my derivation right? Can we use the argument similar to Stokes's theorem that the total covariant derivative integrates to zero?
Why does the second term vanish? In QED we had $\partial^\mu J_\mu = 0$. Do we have its covariant derivative euqals 0 now?
Can we have a non infinitesimal proof?