A man who was shot in the federal building in Maine’s capital after holding a knife to a security officer’s neck has pled guilty to assaulting a federal officer.