Emi
Emi

Reputation: 249

Deploy jar with embedded jetty with maven

I have a (large) maven-web-project with many dependencies. The project runs an embedded jetty.

For some (customer related) reasons I cannot package a war to deploy it to some application server like a standalone jetty or tomcat.

Now I need to deploy the whole project with all dependencies-jars and the web-root stuff to some production-server, where I can start by command line the embedded jetty like java -jar myproject.jar.

How can I build such a package with maven. I tried maven-assembly-plugin, but I do not want to re-pack jars. (IMHO this is not a really good idea.)

I need to package some zip or tar like:

myproject.zip
  --myproject.jar
  --META-INF (with the whole classpath and may be the auto-start class)
  --libs
    --slf4j.jar
    --logback.jar
    --hibernate.jar
    --and many, many more.

Any ideas? TIA!

Upvotes: 2

Views: 648

Answers (1)

user3887584
user3887584

Reputation: 21

If you use Spring you can use Spring Boot which does this by default. By using Spring Boot maven plugin it will build you a uber jar containing all your dependencies and an embed tomcat or jetty.

Upvotes: 1

Related Questions