The Constitution grants to Congress the power to raise and support armies and a navy, to suppress insurrections, and repel invasion among other military-related governmental roles. Thus, the main source of legal authority in this area is federal law. Congress's control over formation, organization and governmnet of the national armies is plenary and exclusive.
Military law consists of the Uniform Code of Military Justice and other statutory provisions for the government of persons in the Armed Forces to which may be added the unwritten common law of the usage and custom of military service as well as regulations and authorized by the President as Commander in Chief of the Armed Forces (See 10 U.S.C. § 121). It is a part of our body of law as a whole, and is fully recognized by civil courts; it is in force in time of peace as well as in time of war. All persons serving in the Armed Forces of the United States are subject to military law at all times.