I have devloped a spring rest-api. packaging it as a war and deploying the same works fine. what has to be done if need to package it as jar. First of all is that correct, if yes, then how to do so. Please help.
Asked
Active
Viewed 1,185 times
-1
-
Maybe it'd help to look at the differences between WAR and JAR files to decide if it's a good idea or not: http://stackoverflow.com/questions/5871053/java-war-vs-jar-what-is-the-difference ----- I don't think a JAR file is appropriate – byxor Aug 18 '16 at 12:34
1 Answers
1
If you are using Maven, just create another project module and move these REST-API classes to that module. The only difference between these classes and "regular" java classes is that they are annotated.
You can still throw the JAR to the classpath and set the package to the "component-scan" directive as a base-package.
You need to use this module together with the main application anyway I suppose.

Sigmar Muuga
- 146
- 7
-
what about the -servlet.xml . where this has to be placed , inside the jar ? – Mohamed Uvais M Aug 19 '16 at 07:05