0

I am new to maven, I have multi level project where too many dependencies are required. I have have multiple doubts regarding packaging.

  1. Is all 3rd party dependencies will packaged in jar or war ? Specifically in jar ?
  2. I have built the war and jars in local system and want to deploy them in production environments. So my question is do I need to install maven in production servers also ?
Rakesh SKadam
  • 378
  • 1
  • 2
  • 18

1 Answers1

0
  1. It depends on your application type. You can package all your dependencies in a jar file. A .war file is rather a different archive which is used to package a web application that can be deployed on any servlet/jsp container. To bundle your dependencies into a single .jar, Look at Maven Assembly Plugin

  2. A .jar can be executed without maven. This StackOverlow post has detail discussion about how to run a Jar file.

Community
  • 1
  • 1
Manish Mishra
  • 796
  • 6
  • 21
  • Based on microservice idea it is recommended to start a single self containing jar in a container...which can accomplished by using maven-shade-plugin as well. And it is not a good idea to put Maven into a container which runs the application...and running an application with Maven in production does not makes sense...The deployment is something different than building... – khmarbaise Nov 26 '16 at 17:20