Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArmin Naderi
18,713 PointsBenefits of embedded container versus wildfly?
What are the advantages/disadvantages of deploying a .war file to wildfly? When is it more appropriate to use a .jar file?
1 Answer
Chris Ramacciotti
Treehouse Guest TeacherHi Armin - if your app needs to run on an application server, you'll want a WAR. However, runnable JARs with embedded servlet containers are nice for their portability and the speed & ease with which they can be started and stopped. Especially with the microservices architecture quickly gaining popularity, lots of companies are migrating to this approach.
When you deploy to Wildfly, some of the libraries you include in a runnable JAR won't have to be included in the generated WAR. This is because Wildfly itself will provide the implementations. For example, JDBC drivers (for database connectivity) can be included in Wildfly, as well as Hibernate. Therefore, your archive becomes a bit smaller than the runnable JAR.