So do resistance movements and terrorist organizations, but nobody ever confuses them with "the military."
No, not really. Resistance movements and terrorist organizations aren't authorized by their greater society, ie. they are not legal organs of a state.
"State" and "greater society" are not at all the same thing. Stateless ethnic/political groups that have their own combat forces are not considered to have a military organization for that very reason: the lack of recognizable legal statute authorizing those organizations on behalf of any government.
I'm not sure what your point regarding international law is. The 24th century interstellar law might not have it's own equivalent of the Geneva Conventions but what does that have to do with current definitions?
Current law require governments to make a clear distinction between military and non-military organizations. Interstellar law does not, which is probably why many species rarely bother to make that distinction. They create organizations with capabilities that best suit the priorities of their government, and apparently they find it more efficient to consolidate those capabilities into a single larger body than a whole bunch of smaller ones with separate command structures and logistics chains. Thus we have people like the Ferengi, whose military is also synonymous with its trade unions and probably its banking industry as well.
Under current IL Starfleet would most definitely be considered an armed force in a conflict.
And "armed force", as I said above, is not always the same thing as "military." The Hagannah and the Irgun were an armed force a full ten years before the state they came to represent ever existed on paper.
Strictly speaking, that's a border security operation, which is usually a job for law enforcement, not the military.
I'm not talking about stoping smugglers or other civilians crossing the border, I'm talking about preventing military forces of a hostile neighbour from getting into your territory.
Which is still a law enforcement issue, since said vessels are typically intercepted, stopped, inspected and sometimes impounded. In the United States it is one of the very few capacities in which a military entity (the Coast Guard) is empowered to act domestically in a law enforcement role. In other countries, it is a role filled by both civilian coast guards and regular military units, whoever happens to be closest. Short of a full blown war, this is usually sufficient.
The thing that makes the U.S. Coast Guard a military organization is the U.S. law
says it is. Nothing more, nothing less. It is one of the very few coast guard organizations in the world that has this feature; most other nations --
Japan, for example -- operate theirs under civilian ministries.
Those other coast guards don't have the traits of a military that the USCG has - they don't fall under a separate legal and judicial system and they don't fight in wars.
Considering we don't actually KNOW anything about the legal system of the Federation, this is a guess on your part.
And yes, the coast guards of those countries DO fight in wars, and have at many times participated in military operations in their nations' coastal waters. Interestingly, the original Revenue Cutter Service -- the civilian law enforcement service that is the immediate predecessor of the Coast Guard -- also participated in war prior to its formalization as a uniformed service.
The law doesn't treat the USCG as part of the military just because. There would be little point in declaring the USCG a military organization if it didn't also have certain traits that are inherent in the term "military".
The Coast Guard was never "declared" to be a military organization; it was CREATED as one in 1915 when two civilian agencies were incorporated into it and was intentionally modeled after the U.S. Navy.
Actually, Japan's military technically isn't even a military, they're considered civil servants under Japanese domestic law. Yet everyone recognizes they are de facto a military. Which might actually be a nice fit for 24th century views on Starfleet
Very true. Except that Starfleet's operations, ships, mission roles and even its rank structure (the suspicious absence of enlisted crewmen on the Enterprise-D) are a better fit for an armed version of NOAA.
Which basically gives you a good model on how Starfleet came to exist in the first place. United Earth came out of the post-atomic horror with a fresh prohibition on the formation of a military space force (much like Japan's Article 9). Since there was no prohibition on the creation of space research agencies, United Earth created Starfleet; since there was no prohibition on ARMING research vessels, Starfleet became Earth's only active combat force in space.
The question of whether or not the Federation has OTHER military forces apart from Starfleet is an interesting one, however. It could go either way, but I find it difficult to believe the Andorians or the Tellarites would give up their fleets and play second fiddle to Earth. THEIR space fleets are almost certainly military in nature, which would probably be more apparent if they ever showed up more than once or twice in 20 seasons of television.
I would go so far as to speculate that the 24th century version of an Andorian battle cruiser would probably resemble a slightly smaller and noticeably more agile version of the Battlestar Pegasus.
