-1

I have a java application packaged into App.jar which has App.java class when ran as Java application starts the jetty server and exposes REST services, now I want the Jar to be embedded in to a WAR project with and when the WAR is deployed in to tomcat I want that App.java to run and bring up the rest services.

I don't want to have the same config in the WAR and don't want to have App.java in WAR again, I should be able to bring up the jetty server when WAR deployed in tomcat (Jetty runs on a different port other than what tomcat runs.)

Any help is appreciated.

Thanks

1 Answers1

-1

Sounds like you want to setup a live war file.

Deploy the war, as a webapp, if you want.

$ cp MyApp.war /path/to/appserver/webapps/

Or execute the war.

$ java -jar MyApp.war

That's a long topic, and the Jetty project has put together an example of this at ...

https://github.com/jetty-project/embedded-jetty-live-war

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136