What are good books or articles (either for free online or for sale anywhere) on the laws of war, particularly how it should be done today and how it will be done when Moshiach comes?
Rabbi J. David Bleich has articles on the topic in his series Contemporary Halachic Problems (e.g. volumes 3 [Preemptive War In Jewish Law, pp. 251-292.] and 4). Also, Rav Nachum Rabinovitch has a popular halacha work for Israeli soldiers called "Melumdei Milchama".
See the first section of Rav Zevin's לאור ההלכה which consists of articles about the halachot of war. See also ערכים במבחן מלחמה: מוסר ומלחמה בראי היהדות, which is about Jewish war ethics. There has been an ongoing debate on the subject of civilian casualties in war from a halachic perspective: in addition to some of the articles cited by @loewian, see also R. Chaim Jachter, "Halachic Perspectives on Civilian Casualties" in Gray Matter, volume 3 (preview available on Google books). R. Neriah Gutel wrote a very comprehensive article in Hebrew about this called לחימה בשטח רווי אוכלוסיה אזרחית, and it is available online. There is also a book called דרך המלך, which I believe is available online, that was written in response to the book תורת המלך which was attacked as racist.