I was under the impression that , mvn deploy do not trigger "install to aem server" but it seems mvn deploy trying to install onto localhost, which does not exist in this case, all i need is to do build and deploy the artifacts to central repository.
Great answer - we marked this correct. If you do not have AEM running, then you can build your project by using this command mvn clean install. If you try and use this command - mvn -PautoInstallPublsh Install and you do not have AEM running - then you will get that error.
Then you should create a new maven profile that will push it whenever you've installed the package in your local maven repository and run without the autoInstallPackage(Publish) profile, but with your new created profile.