LIMA, Ohio — It is an obsession he cannot seem to shake.

Senator John McCain of Arizona has been dead for seven months, but President Trump’s feud with him is very much alive, and in front of a military audience at a tank plant here in Lima, Ohio, on Wednesday, he took it to a new level.

He said he gave Mr. McCain “the funeral he wanted, and I didn’t get ‘thank you,’” exaggerating the role he played in honoring the senator’s death four days before his 82nd birthday.

He blamed him for “a war in the Middle East that McCain pushed so hard.” He said that “McCain didn’t get the job done for our great vets” and the Department of Veterans Affairs. And he was blunt in saying that his animosity toward Mr. McCain was not going to change.

“I have to be honest: I’ve never liked him much,” Mr. Trump said, about 10 minutes into a freewheeling speech that was ostensibly about the resurgence of manufacturing jobs. “Hasn’t been for me. I’ve really — probably never will.”