I don't know why no new line at the end of the file would cause the build to fail. That seems ridiculous. Anyway, I used the GitHub interface to edit the file so it did the trimming.

I like your idea, but I don't know how to implement it. I'd rather just replace my overlay's cas-servlet.xml with upstream's and add back in my one line when changes are made than deal with the hassle of creating a JIRA account just to submit this.