Indeed, the Ming initialy intervened in name of a just and benevolent cause, supporting the Confucian Pacifism hypothesis. However, this intention was betrayed when it decided to annex Vietnam. Therefore, it acted as an aggressor.
This what the book has to say on the subject:
According to Confucianism, once the political objective of a righteous war is accomplished, the invading forces should withdraw. Before sending out the mass army, the Chinese emperor declared that he would withdraw his forces once a new ruler was installed in Vietnam. Now that the Ming had occupied the country, however, its war aim expanded from punitive expedition to conquest. At the suggestion of Ming commander Zhang Fu, who argued that Vietnam had been a part of China since ancient times and would like to become a Chinese territory again, Emperor Yongle went ahead and annexed Vietnam as a Chinese province, establishing an administrative structure akin to inland provinces such as Guangxi and Yunnan. Attempts were made to assimilate the Vietnamese. The new province was named Jiaozhi, Vietnam’s ancient name in the Tang dynasty.
The conquest of Vietnam paid off handsomely. As a result of the war, Ming China obtained 13.6 million piculs of grain, 230,590 elephants, horses and cattle, 8,677 ships, and 2.5 million military weapons. Ming records show that Vietnam had a population of about 3,120,000 and an unsinicized tribal population (manren) of 2,087,500. 39 The acquired grains were substantial, almost equal to the amount of grain (14.4 million piculs) produced by Ming military colonies in 1407.
Vietnam proved to be a hard place to administer. The Chinese conquest “ignored the strength of the historical traditions of Vietnamese independence and their hostility toward Chinese overlordship.” The Vietnamese resented Chinese rule and rebellions soon followed. At first, the Ming was able to subdue these rebellions by its preponderant military might; twice between 1408 and 1413, it sent armies to crush the insurrections. Vietnamese resistance notwithstanding, China was able to keep the territory for about two decades as a province. Nevertheless, constant rebellions developed into a financial and military burden on Ming resources. The costs of administering the new
territory soared. One commander reported in 1421 that the Chinese armies in Vietnam suffered from the problem of insufficient supplies and that the hit-and-run tactics of the Vietnamese guerrillas had made it increasingly difficult to maintain Chinese positions there. The pressure to withdraw began to build up.
Zhang Fu, the commander who conquered Vietnam in 1407, insisted on continuing the occupation: “Our officers and men have endured years of hardship to conquer [Vietnam]. This petition is a ruse by Le Loi. We should send more troops to wipe out the rebels.” Jian Yi and Xia Yuanji repeated their previous view that withdrawal would reveal Chinese weakness to the world. On the other hand, Yang Rong highlighted the strain of war and urged acceptance of Le Loi’s peace proposal: “We may turn disaster into good fortune. The suggestion to send in more troops should not be adopted.” Yang Shiqi suggested that the original plan of Emperor Yongle was not to annex Vietnam as a province, but to restore the Tran throne. The next day, the Chinese emperor announced his decision to withdraw from Vietnam.
The initial Vietnam campaign supports the just war theory of Confucian pacifism, but the subsequent conquest refutes it. Le Qui-Ly’s usurpation of the throne and his deception of the Ming court provided a just cause for China, the suzerain of the tribute system, to send an expeditionary force to restore the Tran house. But the Ming decision to annex Vietnam violated the Confucian principle. Our case study shows that the Ming war-aim expansion and the reluctant withdrawal from Vietnam support the power-based explanation of structural realism. Without military and systemic constraint, the Ming took advantage of the opportunity to increase power. However, the high cost of continuing the occupation finally compelled the Ming to withdraw from Vietnam. The Confucian precept of withdrawing after a righteous war
offered a good face-saving justification, although it was already twenty years later. Emperor Xuande and the two Yangs all cited historical precedents in accordance with this Confucian principle. The fundamental cause of withdrawal, however, was the enormous financial burden and Chinese inability to suppress Vietnamese insurgences. Ming China weighed the costs and benefits of conducting further military campaigns and concluded that the costs outweighed the benefits