The Federation Starfleet is explicitly referred to as the military in
Star Trek II: The Wrath of Khan by David Marcus, and Carol Marcus counters him not by claiming that it isn't a military but by claiming that it has kept the peace. Captain Kirk and Nog both refer to themselves as soldiers in "Errand of Mercy" and "
Valiant," respectively. Starfleet is called upon to enforce
martial law on Earth in "Homefront"/"Paradise Lost" (
martial being an adjective form of
military). Starfleet is referred to as "the service" in "Court Martial" and "Dr. Bashir, I Presume?" And finally, Starfleet administers a system of courts-
martial, as evidenced in "Court Martial," "The Measure of a Man," and numerous other episodes. And, finally, Starfleet is the agency legally empowered to use violence in defense of the state during times of war, which is the definition of a military.
Now, they may not use the word "military" -- the meaning of that word may have evolved. "Military" used to mean "armed forces that operate on land," for instance; maybe it means "armed forces dedicated to planet-side combat but not space combat," for instance. (Though David Marcus's use of the term "the military" and the other forms of
military that appear in ST would seem to imply that they use the word with the same meaning we do today.) And certainly we can all agree that Starfleet is not milit
ant -- it's not out to start wars, it's not imperialistic, it's not ethnocentric, it's not jingoistic, and it's more oriented towards exploration, diplomacy, peace-keeping, and humanitarianism.
But even if they use a different
word, the actual legal definition of what Starfleet is fits the definition we presently use for the word "military." The concept is the same. Starfleet is
not a civilian organization -- it is the armed forces of the United Federation of Planets.
ETA:
The
only piece of canonical evidence against the idea of Starfleet as a military is Picard's infamous line in "Peak Performance." The preponderance of canonical evidence is clearly not on the "not military" side of this argument.
And just to keep this relevant to TrekLit...
Chapter 3 of
Slings and Arrows: Enterprises of Great Pitch and Motion by Keith R.A. DeCandido establishes very firmly that Starfleet is a military.
Enterprises of Great Pitch and Motion said:
Starfleet's primary mission had always been exploration. While Starfleet was obviously a military organization, with its rank structure and internal regulations and enforcement, it was never militaristic. Its function was to keep the peace, not start the wars.
Bold added.
ETA
again:
It's a military organization, though it's obviously evolved beyond what most people think of as a military in the present day. Starfleet is to today's military as today's military is to that of the 1700s.
Dayton,
Any ranks in Starfleet that is NOT used anymore in our military or vice versa?
The rank of "Commodore" is not used in the current United States Navy (though it remains as a position rather than a rank), being replaced with the rank of "Rear Admiral, Lower Half." TNG, DS9, and VOY discontinued using "Commodore" as a rank after the USN ended its use in real life. TrekLit set in the TNG era has occasionally featured officers with the rank of Commodore, however.