Skip to main content

Posts

Showing posts from July, 2023

Put your WARs on a diet with Maven: Maven and skinny wars!

I have seen a lot of confusion and misunderstanding on what is and why use a java enterprise concept called skinny war . In simple terms , a skinny war is a WAR where some of its dependencies are moved from the WAR module WEB-INF/lib to the EAR lib folder .   This post is specifically written to deal with skinny wars and does not explain or go into details which jars must be in the WAR class loader and which one do not have to . It is assumed that the reader is familiar with this concept and the concept of the WAR class loader versus the application class loader . Suffice it to say that typically, JAR that must be scanned by CDI usually belongs in the WAR class loader . Web fragments and jars with tag libraries are other candidates . Also, all test and provided scope artifacts must be specified in the WAR module as having maven remove them from the WAR does not make sense as they were never to be put there and having them in a deps POM file does not work . They will not be e