The Be’er Hagolah is a sefer written by an anonymous author in Amsterdam during the period of the Sabbatean movement (late 1600s). In Chapter 25, Section 2, after describing the wars fought by the Jewish people in times of old, he writes: But now the mighty men of Israel have fallen and their weapons have perished. Since the enemy overcame us and the anointed kohein and the general failed and were smitten in battle, Israel has known that the Holy One, blessed is He, no longer desires their wars; Hashem has departed from them until the time of the coming of moshiach. And regarding this matter, and regarding the exile of Israel, David prayed and said, “You, O G-d, have thrown us away, and You do not go forth, O G-d, with our army” (Tehillim 60:13). And now, if Israel will arise and wage wars against the desire of the Holy One, blessed is He, they will fall by the sword, as it is written, “Do not go up, for Hashem is not in your midst, and then you will not be defeated by your enemies!” (Bamidbar 14:42). For just as the Holy One, blessed is He, used to fight their wars when the those wars were in accordance with His will, so too He will become their enemy when the war is against His will, as it is written, “And He became their enemy; he fought against them” (Yishaya 63:10).
The Be’er Hagolah continues in Section 5: And when Israel saw this, they chose to scatter themselves in all four corners of the earth, so that the nations might see that they had no thought of waging any more wars with them, and that they would not emerge from the exile until moshiach comes. And even if during that time they have some mighty men, still they will not wage war against the nations, for this is what Shlomo, the king and prophet, made them swear by the name of Hashem when he said, “I have adjured you, daughters of Jerusalem, not to arouse or awaken the love before it is desired” (Shir Hashirim 2:7). Behold, he said to the daughters of Jerusalem: If you be in exile among the nations, do not arouse or awaken with them any war because of the love of Eretz Yisroel, until it is desired – until it is the will and desire of Hashem Yisborach to do so, and He sends you the moshiach, just as He sent Moshe to Egypt to say, “So said Hashem: I have surely remembered you” (Shemos 3:16). Then they will know that it is the will of the Holy One, blessed is He, that they should gather themselves from all the four corners of the world and become a great and powerful nation, to take their land away from the Ishmaelites. The prophet Yishaya expressed amazement at them and said, “Who are these who fly like clouds?” (60:8) “Who bore me these?” (49:21) “Can a land have birthpangs in one day…for Zion has had birthpangs and born her children” (66:8). And since it is so, all of Israel has decided not to study warfare anymore, even to assist one nation against another, unless it is the will of their kings under whom they live. And each one prays in the land where he lives that Hashem grant peace and success to the king who rules over that land… And since Israel saw this, they did not seek, nor did their soul desire, to go out of exile until the time when Hashem desires it.