More than 100 protesters forced open the shuttered entrance to the ministry complex, crossing the courtyard and blocking the entrance to the general staff building. Riot police were called in to force back the demonstrators, who were demanding to meet with ministry officials.
"First get off my base," Gen. Michalis Kostarakos told the protesters, arguing the military had no part in the shipyard workers' dispute with the government.
Police said several dozen demonstrators were detained for questioning, prompting another protest gathering outside police headquarters.
Workers from the Skaramanga Shipyards, which deals mainly with military contacts, say they have not been paid in months. Scuffles broke out as protesters attempted to push through the police cordon protecting the entrance to the main building.
Greece has been gripped by a severe financial crisis since late 2009, and waves of spending cuts and tax hikes have led to frequent strikes and demonstrations.
The coalition government is currently preparing a major new austerity package demanded by rescue creditors.
Finance Minister Yannis Stournaras said Wednesday there were still considerable differences between the government and Greece's debt inspectors from the International Monetary Fund, European Commission and European Central Bank over the new austerity package. But he said he hoped to clinch a deal by next week.