Then why is the lineage of Joseph given in Luke and Matthew?
I don't know.
There is also a lineage of Y'shua in John.
B'shem Y'sua chuck