Reputation: 13245
I currently have a Maven archetyped Common JAR which houses shared Java classes which are common to two mutually exclusive Maven archetyped WAR projects.
I have recently spotted an opportunity to re-use some custom error webpages, an accompanying JSF backing bean and a portion of supporting web.xml configuration (as a web fragment) to this JAR.
My question is a Maven one: How would I configure my two WAR applications to "see" these web pages?
Upvotes: 0
Views: 492
Reputation: 12870
You should be looking into so called skinny war and war overlays features.
You can create a module with packaging war which contains your shared resources. Now when other war module depends on it - dependecy with type "war" - these files will be added to the new war. It is preferable to exclude jars from your skinny war because you don't want to bundle them and keep in maven repository.
Upvotes: 1