Let's take a look at the chord tones of some common G chord shapes with dominant and major sevenths. All these chords will have the same root of G, for comparison purposes.
Gmaj7
Gmaj7 is built with G B D F#, the 1st, 3rd, 5th, and 7th notes of the G major scale.
Let's take a look at a few more common chord shapes that use the barred first finger.