Chaturvedi Dewashish
Chaturvedi Dewashish

Reputation: 1469

Standard way of deploying maven projects

I have two maven projects, which I need to deploy through automatic deployment process. (like nightly build or similar)
Scenario is as:

mv-proj1
 -dependency-1.jar
 -dependency-2.jar
 -dependency-3.jar
mv-proj2
 -dependency-3.jar
 -dependency-4.jar
 -mv-proj1.jar

sources of mv-proj1 and mv-proj2 can not be disclosed.
mv-proj2 is executable jars and provide services to other application modules.

So what is the standard way of deploying these to production machine or lets say UAT machine?
Do I need to set up intra-organization maven repository?
Do I need to install maven repository to UAT machine?

One possible way I could think is to set up and host intra-organization maven respository as well as setting up maven on UAT machine to fetch data from intra-organization maven respository. and deploy only pom.xml.

Upvotes: 0

Views: 155

Answers (1)

Sander Verhagen
Sander Verhagen

Reputation: 9118

I would let my choice depend on what the consumers of your artifacts are.

If the consumers are also Maven projects that can pull in your JARs from said intra-organizational Maven repository, that's definitely a great way to go. I believe that every organization that is serious about using Maven is sooner or later going to have use cases for such own repository anyway. I've worked with Artifactory and Nexus and feel that both are great products (and free beer for the use case as stated here). They're both easy to install, and it should not be an exploration that is daunting, go for it!

If your UAT machines would use Maven to build and install anything that pulls in your artifacts as a dependency, them would be running Maven client-side. There would be a local repository (artifact cache) on these clients, but that's a different beast than the organizational repository mentioned above, which you would likely deploy not on the actual UAT machines.

If mv-proj2 is rather a "final delivery", executable as you say, you may want to pack it all up as a nice, single JAR (Maven can do that for you) and distribute that to your users. You could do that again through an organizational repository. You could ultimately release it to some network drive or web server. Many ways to do so, e.g. use maven-jar-plugin with outputDirectory pointing to wherever you want to release.

Upvotes: 1

Related Questions