Most of the exocrine glands in vertebrates are developed from ectoderm.
The gonads and gonadal glands are developed from the mesoderm.
Almost all endocrine glands including thyroid, pancreas etc are devevloped from the endoderm.
Hence, glands in vertebrates develop from ALL ectoderm, mesoderm and endoderm.