Have pigs ever been kosher? No. But have Jews ever been permitted to eat them? Yes! Apparently for 7 years…
If we say that the dilemma is with regard to the seven years during which they conquered the land, now, non-kosher items were permitted for them during that period, as it is written: “And it shall be, when the Lord your God shall bring you into the land that He swore to your fathers, and houses full of all good things…and you shall eat and be satisfied” (Deuteronomy 6:10–11), and Rabbi Yirmeya bar Abba says that Rav says: Cuts of pig meat [kotlei daḥazirei] that they found in the houses were permitted for them…
So, for 7 years Jews were permitted to eat pig!! By the way, this sets a law. The Rambam teaches, that it’s at any time when we would otherwise starve.
Mishneh Torah, Kings and Wars 8:1
חֲלוּצֵי צָבָא כְּשֶׁיִּכָּנְסוּ בִּגְבוּל הָעַכּוּ”ם וְיִכְבְּשׁוּם וְיִשְׁבּוּ מֵהֶן. מֻתָּר לָהֶן לֶאֱכל נְבֵלוֹת וּטְרֵפוֹת וּבְשַׂר חֲזִיר וְכַיּוֹצֵא בּוֹ אִם יִרְעַב וְלֹא מָצָא מַה יֹּאכַל אֶלָּא מַאֲכָלוֹת אֵלּוּ הָאֲסוּרִים. וְכֵן שׁוֹתֶה יֵין נֶסֶךְ. מִפִּי הַשְּׁמוּעָה לָמְדוּ וּבָתִּים מְלֵאִים כָּל טוּב עָרְפֵּי חֲזִירִים וְכַיּוֹצֵא בָּהֶן: When the army’s troops enter the territory of gentiles, conquering them and taking them captive, they are permitted to eat meat from animals that died without being ritually slaughtered or which were trefe, and the flesh of pigs and similar animals, if they become hungry and can only find these forbidden foods.
Similarly, they may drink wine used in the worship of idols. This license is derived by the Oral Tradition which interprets Deuteronomy 6:10-11: ‘God… will give you… houses filled with all the good things’ as ‘pigs’ necks and the like.’
