I want to create a REST webservice and want to know if it can be packaged as a jar file. Basically, is it possible that we do not create a war file of this webservice, rather just package as a jar and then put it on Tomcat lib folder? If that is possible, I would appreciate any help on how to create this kind of webservice; as all the hello-world, examples that i checked on net are packaging as war file only.
Asked
Active
Viewed 566 times
-1
-
3What's wrong with a war file? – Amila Sep 16 '15 at 04:49
-
3How do you plan on using the JAR? Typically, the web service you create will expect all incoming requests to hit a servlet which is part of a WAR file. – Tim Biegeleisen Sep 16 '15 at 04:49
-
WAR is just a JAR with some extras. – rkosegi Sep 16 '15 at 06:51
2 Answers
0
For our project which is developing a large scale RESTful web service we use Gradle. You may find the https://spring.io/tools very useful. We find Gradle as a very powerful tool.

Albert Pinto
- 392
- 2
- 6
- 17
-1
If you are looking at a webservice as a JAR file, it doesn't make any sense as all your configurations would be J2EE based. However, if you are aware of JBoss Fuse and OSGI frameworks, that allows you to have bundles as you require.
But I don't think OSGI is an option for you and in simple words, You cannot package as JAR unless it's OSGI bundles.

Karthik R
- 5,523
- 2
- 18
- 30
-
You can package as JAR if you use WRAP provider (which is by default available in Karaf/JBoss Fuse). I did not downvoted you answer – rkosegi Sep 16 '15 at 06:52
-
@rkosegi Yeah. That's what I meant. We can package as JAR for OSGi. Not sure why it's been downvoted without explanation. – Karthik R Sep 16 '15 at 07:12