Fix deploy and undeploy to use JMX.

I meant to do 2 pull requests but made a mistake and so the change to pom.xml is in this pull request.  If you can remove it and make it its own pull request that would probably be better than including it in this request as the pom change has nothing to do with deployment.