Gábor Lipták
Gábor Lipták

Reputation: 9776

How to deploy locally already installed artifact with Maven

Story

I know, that maven deploy command runs through the whole lifecycle. My problem, that it takes to much time in my case. Let me explain:

Question

Building everything twice takes a lot of time. Is there anything like "please simply deploy all built artifacts as they are from my local repository to the POM defined repository with skipping the whole lifecycle"?

Upvotes: 9

Views: 6518

Answers (2)

oberlies
oberlies

Reputation: 11723

I don't think that there is a pure Maven solution to this. The problem is that your deploy only build won't know which artifacts to deploy – AFAIK this information is only in the in-memory Maven model and not persisted to the target folder.

The problem can be solved with a Maven repository manager that supports staging, like the (commercial) Nexus Pro. Then, your build would deploy straight away into a staging repository, and only promote the artifacts to the (main) repository if everything succeeded.

Upvotes: 2

Charlee Chitsuk
Charlee Chitsuk

Reputation: 9059

If you have the artifact already by the previous build, you may consider the deploy:deploy-file by following the Guide to deploying 3rd party JARs to remote repository. I always use this goal to publish some stable artifact to the developer public remote repository for letting other team to test/use.

I hope this may help.

Upvotes: 7

Related Questions