The speaker refers to war a number of times in the poem, and without proper context, it can be a bit confusing. What's important to know is that this poem was written during the American Civil War. Whitman orients his celebration of New York's harbors as a means of advocating for them to join him in aiding the war effort.