Sup guys im new to this but i need some help with a song im writing.
I made a chord progression and it goes:

Gmaj7 B7 A7? D7
2 2 3 2
0 0 2 1
0 2 2 2
0 1 2 0
2 2 0 x
1 x x x

So my problem is im trying to write a lead or solo to it but im not sure what scale to use. and im not even sure if the chords can go into a progression together, i mean it sounds good to me but the notes that are in the chords itself dont go in any scale together. Can someone please explain to me how these chords go together(if possible) and a brief explanation of how to solo over major 7th chords and dominant 7th chords in the same progression? ive been using the E natural minor scale to solo over it but i want to kno more about the theory side to these chords and how they can go together.
P.S. i want to make the solo kinda mellow and melodic

Thanks guys, Josh
The progression is in G as the V chord (D7) really wants to pull to the Gmaj7 chord. The B7 and A7 are not diatonic, but you have just sharpened the 3rd interval in each chord.

So over the progression you can use the Gmaj scale, but be careful of playing the C not over the A7 as it will clash with the C# note in the chord. Also avoid the D note over the B7 chord as it will clash with the D# note in that chord.

A good way to approach soloing, especially if you want mellow and melodic, is just to traget the chord tones as you play.
There's no need to find a single scale that fits over non-diatonic progressions. In fact, you're better off actually following the key changes.

Play melodies based on the chords' arpeggios, not the scale of the tonic chord. You actually want to make it sound like you're playing along with the chords.

Do not base your musical ideas on what should be avoided.

Learn the chord tones all over the neck, and use passing tones and other non-harmonic tones to link them. You should base this on a loose understanding of scales, but don't strictly adhere to scales all the time.
Only play what you hear. If you don’t hear anything, don’t play anything.
-Chick Corea
you can take the sharp feel of the dominate 7th chord away by using a minor 7th chord a fifth higher ..for B7 you can use F#mi7...and in this case a mi7b5 would be very nice as it can also be used as a D9..for the A7 try Emi7 and for the D7 try Ami7...

Harmonically, overall, you are going from I to V to I when using substitutions such as the above..it makes using "out of key" chords have a logic and function..and not just some random choice..though many nice progressions and melodies come from that method also..

Use basic arpeggios for the minor chords to start with and experiment with melodic patterns within each run..you will discover many melodic passages with just the few chords you have to work with..

a further study of diatonic harmony would expand your ability to use substitutions for melodic development..

play well

You simply cannot use the exact same scale over the whole thing as mentioned above.

I would use G major pentatonic (a.k.a. E minor pentatonic) as a base or E natural minor as you suggest, and then make small adjustments over each chord change:

Gmaj7: normal G penta - optional use F# to accent maj7 sound
B7: raise the 7th - play D# instead of D - otherwise normal G penta
A7: normal G penta - optional use C# (raised 4th) to accent A7 chord sound
D7: normal G penta - optional use F# to accent D7 sound and help tonicize the G

As to the theory side of it:

By starting on Gmaj7, you put the tonality on G. Becuase E minor is the relative minor or G major, the B7 briefly tonicizes the E minor chord (even though you never play it). The A7, following the B7 gives it a kind of E blues feel, since the E is tonicized and the B7 and A7 are the V7 and IV7 of E, standard blues chords. To my ears, the D7 subtley tonicizes the D because A7 is the V7 of D, but in the overall context it also serves as the dominant in the progression as a whole and brings you back nicely to the key of G.

Good luck