It looks like the original
Star Trek Writers/Directors Guide (1967), although dated, has the answer to your question on page 27 (page 30 in a document viewer):
Is the starship U.S.S. Enterprise a military vessel?
Yes, but only semi-military in practice -- omitting features which are heavily authoritarian. For example, we are not aware of "officers" and "enlisted men" categories. And we avoid saluting and other annoying medieval leftovers. On the other hand, we do keep a flavor of Naval usage and terminology to help encourage believability and identification by the audience. After all, our own Navy today still retains remnants of tradition known to Nelson and Drake.
It is clear that the original idea behind
Star Trek was that the concept of military was an "annoying medieval leftover", and that Starfleet supposedly "evolved" from it.
It is also worth noting that the main
Star Trek antagonists, Klingons, were portrayed as sort of skewed medieval space aliens. This is why their vests in TOS resembled chainmail and why they have been so fond of using melee weapons in general.
Something else worth of note is the following part on the same page:
The mission of the U.S.S. Enterprise? Isn't it something like that of, say, English warships at the turn of the century?
Very close. As you recall, in those days vessels of the major powers were assigned to sectors of various oceans, where they represented their government there. . . .
Starfleet is definitely not a paramilitary, especially when there is no official Federation military to be "para-" to. This is proven by a couple of things. First, there is the following line of dialogue from
TNG: "Preemptive Strike":
PICARD: Starfleet does not condone the Maquis' actions in the Demilitarised Zone any more than your government would condone the paramilitary actions of Cardassian civilians.
Second, the Maquis have been officially defined as a paramilitary group in
The Star Trek Encyclopedia, which has the following description at Memory Alpha:
The same reference book does
not define Starfleet as paramilitary.
As far as reference books go, the article at
Wikipedia: Star Trek canon has the following to say:
A special case is made for "non-fiction" reference books such as
The Star Trek Encyclopedia,
Star Trek Chronology,
TNG Technical Manual and
DS9 Technical Manual. Unlike the novels and novelizations, these reference manuals have never been explicitly named as non-canon, and the fact that they were officially sanctioned by Paramount and given to episode writers as guides serves to give them an aura of credibility. Roddenberry himself considered it part of the "background" of
Star Trek. Meanwhile,
Michael Okuda and
Rick Sternbach, two art and technical consultants since
Star Trek: The Next Generation and the authors of several of these reference books, considered their work "pretty official". However, they stop short of naming the books canon, leaving the debate open.
Star Trek writer and co-producer
Ronald D. Moore dismisses such official material as "speculation", and says that the writing staff did not consider it canon. However,
Viacom, the parent company of Paramount, seems to believe differently. In a series of posts to the official
Star Trek website's forums, Viacom Senior Director Harry Lang left no doubt that he considers the reference books as canon.
Then, of course, Starfleet has JAG and court-martial, which are unique to a military organization.
That is all. Bye!