Expand my Community achievements bar.

mvn deploy fails with "installation on http://localhost:4502 ... failed" reason : connection refused

Avatar

Level 7

I am trying to have a common bundle deployed to internal central repository.

when I do mvn deploy on aem project it is giving me following error, any ideas?

mvn deploy fails with "installation on http://localhost:4502 ... failed" reason : connection refused

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.

Thanks,

Sri

5 Replies

Avatar

Level 4

mvn clean install will only build the projecy

used with a profile like -PautoInstallPackage or -PautoInstallPackagePublish will deploy it.

Is this what you are looking for?

Avatar

Level 10

@Rima Mittal -

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.

Avatar

Level 7

Let me rephrase my question.

What i want to do is mvn deploy and that should build, deploy artifacts to central nexus repository.

I do not want to trigger install or install with profiles.

This is a foundation project like acs commons used across all other projects as a dependency.

Avatar

Level 2

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.

Avatar

Level 4

When we run 'mvn clean install', there are different plugins that come into action, all defined in pom.xml under the <pluginManagement>; for example maven-clean-plugin, maven-resources-plugin etc.

For your requirement here, you will have to use the maven-deploy plugin, please see details at Apache Maven Deploy Plugin - Introduction.

Its usage can be found at Apache Maven Deploy Plugin - Usage

This way, you wont have to run your command with a profile option and you can have artifacts deployed to your internal remote repository.

Hope this helps!