No. Prophet Muhammad forbade offensive attacks of all forms. He only permitted fighting in self-defense, and specifically forbade attacking innocent trade caravans.
During the time of the Prophet, Arabs largely earned their living by trade with nations in the north then known as Syria, now divided into many smaller countries. The trade routes from Mecca towards north passed near Medina. Arabs also conducted local trade from one town to another.
Critics allege that Prophet Muhammad began raiding the camel caravans of Arab traders traveling between Mecca and other Arab towns and oases. Some critics claim that Prophet Muhammad organized as many as eighty-two raids, personally leading over twenty, and cite the Quran 2:217  as the “justification.”
We begin by presenting the full verse in question:
Fighting is ordained for you, though it is repugnant to you; but it may be that you dislike a thing while it is good for you, and it may be that you like a thing while it is bad for you. Allah knows all things, and you know not. 
In this verse, the Holy Quran reminds Muslims that, due to the Meccan’s massive hostilities against them, their thirteen years of non-violent resistance in Mecca and peaceful emigration 240 miles away unfortunately has not changed the hostile behavior of the Meccans. Therefore, the Muslims should be ready to fight even though they do not wish to fight. Of course, the Muslims did not wish to fight.
That is exactly why they bore persecution patiently for thirteen years and migrated to a different region altogether—to avoid fighting. The verse is a commentary on human nature. These Muslims had suffered for over a decade in Mecca, left all their homes, properties, belongings, and ancestries to emigrate, all for the sake of peace. Now, war pursued them once more. It is completely reasonable to believe that some Muslims were tired of the persecution, suffering, and running. They simply wanted peace—but the Quran admonished them to remain firm because God knew the consequences of their acquiescence to Meccan aggression.
Commenting on this situation, the Prophet Muhammad reassured the Muslims,
O ye Muslims! you should not desire to fight the enemy, and remain desirous of the peace and security of God. If however, contrary to your desire, you are compelled to fight an enemy then demonstrate steadfastness. 
This is a universal principle. Sovereign governments throughout history and even today enact mandatory drafts to ensure that their nation remains secure against attack. Critics who find objection with this verse should also declare that all nations that obligate fighting for the security of their citizens are behaving unjustly.
Turning specifically to the issue of the alleged plundering raids, history records elicit facts contrary to what critics fabricate:
Āṣim bin Kulaib relates from his father that an Anṣārī Companion narrates that, we set out on a Ghazwah with the Holy Prophet. On one occasion, the people were struck by severe hunger and became very much distressed (since they had no provisions with them). Upon this they caught a few goats from a flock, slaughtered them and began cooking them. Our pots were boiling with their meat when the Holy Prophet arrived. The Holy Prophet immediately upset our pots with his bow and angrily began grinding the pieces of meat beneath his feet and exclaimed, ‘Plunder is no better than carrion. 
History is clear. Let alone during times of prosperity, even in the face of severe hunger, Prophet Muhammad forbade plunder of any sort. In another famous tradition, Prophet Muhammad commanded the Muslims,
O ye Muslims! go forth in the name of Allāh and perform Jihād with the intention of protecting religion. But beware! do not embezzle the wealth of spoils and do not deceive a people. Do not mutilate the enemy dead, do not kill women and children , nor religious recluses ; and do not kill the elderly. Create peace in the land, and treat the people with benevolence, for surely, Allāh loves the benevolent. 
Once again, Prophet Muhammad(sa), in word and deed, explains that the purpose of fighting is to protect religious freedom—not wealth, power, or terror. He specifically forbade Muslims from harming innocents, condemned violence, and implored benevolence.
Islamic history scholar Hazrat Mirza Bashir Ahmad details the purpose of the raids that were undertaken by the Prophet, and demonstrates that they were not unjust, but a just form of defense that nations even today employ,
The fourth strategy [to protect Muslims from the mischief of idolaters] employed by the Holy Prophet was that he began to intercept the trade caravans of the Quraish which travelled from Makkah to Syria passing by Madīnah en route. The reason being that:
- These caravans would spark a fire of enmity against the Muslims wherever they travelled. It is obvious that for a seed of enmity to be sown in the environs of Madīnah was extremely dangerous for the Muslims.
- These caravans would always be armed and everyone can appreciate that for such caravans to pass by so close to Madīnah was not empty of danger.
- The livelihood of the Quraish primarily depended on trade. Therefore, in these circumstances, the most definitive and effective means by which the Quraish could be subdued, their cruelties could be put to an end and they could be pressed to reconciliation, was by obstructing their trade route. As such, history testifies to the fact that among the factors which ultimately compelled the Quraish to incline towards reconciliation, the interception of these trade caravans played an extremely pivotal role. Hence, this was an extremely sagacious strategy, which yielded fruits of success at the appropriate time.
- The revenue from these caravans of the Quraish was mostly spent in efforts to eliminate Islam. Rather, some caravans were even sent for the sole purpose that their entire profit may be utilized against the Muslims. In this case, every individual can understand that the interception of these caravans, was in its own right, an absolutely legitimate motive.
Various prejudiced Christian historians … have raised the allegation that, God-forbid, the Holy Prophet and his Companions would set out for the purpose of plundering the caravans of the Quraish.
We would like to inquire of these people who are an embodiment of justice and equity, that do your nations, who you consider to be the epitomes of civility and nobility, not obstruct the trade routes of enemy nations? When they receive news that a trade vessel belonging to such and such enemy nation is passing by so and so place, do they not immediately dispatch a naval company in its pursuit so as to destroy it, or employ a strategy to subdue it and take possession of its wealth?
Then for this reason can your leaders be labelled as robbers, pillagers and plunderers? Verily, if the Muslims intercepted the caravans of the Quraish, its purpose was not to take possession of the wealth of their caravans. Rather, military tactics demanded that the trade route of the Quraish be obstructed, because there was no better means by which they could be brought to their senses and pushed to reconciliation. To assert that in the interception of these caravans, the Muslims were given teachings of pillage and plunder, is a grave injustice and far from equity. 
The above-mentioned authentic references should clarify to any fair-minded reader that Prophet Muhammad did not engage in any injustice regarding war. He certainly did not in any capacity raid innocent trade caravans. On the contrary, he demonstrated extreme restraint and benevolence.
 Geert Wilders, Marked for Death: Islam’s War Against the West and Me, 37 (2012).
 Qur’an 2:217 (Wilders also cites numerous other random verses in his footnote without offering any indication as to how they connect to his opinion. Should the reader require a response to those allegedly violent verses, we remind them of the link www.alislam.org/quran for a detailed analysis of each verse.
 Bukhārī, Kitāb al-Jihād Wa al-Siyar, Bāb Kāna al-Nabiyy Idhā Lam Yuqātil Awwal al- Nahār, Muslim, Kitāb al-Jihād Wa al-Siyar, Bāb Karāhah Tamannī Liqā’ al-‘Uduww, and Sunan Abī Dāwūd, Kitāb al-Jihād, Bāb Fī Karāhah Tamannī Liqā’ al-‘Uduww.
 Sunan Abī Dāwūd, Kitāb al-Jihād, Bāb Fi al-Nuhba Idhā Kāna Fi al-Ta‘ām Qillah and Sunan Al-Tirmidhī, Kitab al-Siyar, Bāb Mā Jā’a Fī Karāhiyah al-Nuhbah (emphasis added).
 Muslim, Kitāb al-Jihād Wa al-Siyar, Bāb Ta’mīr al-Imām al-Umarā’ a ‘Ala al-Bu‘ūth.
 Sharḥ Ma‘āni al-Āthār, By Imām Abū Ja‘far Aḥmad bin Muḥammad Al-Ṭaḥāwī, Volume 2, p. 126, Kitāb al-Siyar, Bāb al-Shaikh al-Kabīr Hal Yuqtal Fī Dār al-Ḥarb Am Lā, Maktabah Raḥmāniyyah, Urdu Bazaar, Lahore.
 Sunan Abī Dāwūd, Kitāb al-Jihād, Bāb Fī Du‘ā’ al-Mushrikīn.
 Mirza Bashir Ahmad, Seal of the Prophets, Volume II, 91-92 (2013).