The chemical reactions and pathways involving adenine, 6-aminopurine, one of the five main bases found in nucleic acids and a component of numerous important derivatives of its corresponding ribonucleoside, adenosine.