The first thing to do is to create a new pom.xml file for the shared library. A simple example can look like this...
<?xml version="1.0" encoding="UTF-8" ?>
That of course is not enough but the important part to take away from the snippet above is the package is set to war. This means we will be using maven-war-plugin to create the package, this is configured a little bit later on.
Before continuing I like to set up a number of properties to make the pom.xml file more portable. In this case I define all the key elements I would like to configure for my shared library by adding a properties section to the pom.xml file...
Now with those properties set I I can define the configuration for maven-war-plugin. It looks a little like this...
The configuration is fairly straight forward, all it does is set failOnMissingWebXml to false so that the packager ignores the fact that we don't have a deployment descriptor (since it is not needed in this case). It sets up the manifest file in a way that WebLogic would recognise.
Ok so far so good but where are the JAR files that make up the shared library? This is configured through dependencies. Assuming you already have the JAR file either in your local Maven repository or in the remote repository, simply define a compile scope dependency and the JAR file will be included automatically. It is possible to have multiple JARs in the final WAR file simply by defining multiple dependencies like this.
Now just put all that together into one pom.xml file and you're good to go.