Not World War II, but World War I:
The 1st Edition of Abraham Fraenkel’s book Einleitung in die Mengenlehre (Introduction to Set Theory) went to press during World War I. Fraenkel had been teaching set theory to his comrades while at war, and this book was his lecture notes, so to say. He also gave his venia legendi lecture during the war, while on furlough.