Gerald Nunn's Blog
« Setting up an HTPC with MythTV | Main | Upgrading lirc in Mythbuntu 8.0.4 »Maven, WebLogic Portal and APPC
Tuesday, June 03, 2008
The WebLogic utility appc is an indispensable tool for pre-compiling JSPs and generating EJB classes. Unfortunately it turns out to be somewhat difficult to use appc with Maven and WebLogic Portal for a number of reasons.
The largest is that in WebLogic Server 10 the packaging of weblogic.jar changed significantly. Instead of being one uber-jar it is now a jar that is more focused on WebLogic implementation with many secondary features and interfaces moved to other jars in the modules directory. In order to make it easy to still compile applications by adding just weblogic.jar to a classpath, this jar now supports the JDK 1.5 extension mechanism whereby dependencies are linked in the manifest in a relative fashion.
The problem with this is that we cannot use Maven to pick up weblogic.jar from a repository since all the dependencies in the manifest are based on relative paths. One potential solution is to unwind the dependency tree and create equivalent dependencies in a repository by explicitly declaring dependencies in the libraries pom.xml. As you can imagine though this would be a fairly arduous task that would be somewhat brittle, every time a new release of WLS became available someone would have to once again unwind all the dependencies and create the necessary POMs.
I suspect that at some point Maven would support registering a file and the dependencies declared in a JAR automatically but that time has not yet arrived. Given I'm not a big fan of manual labor I opted to create a quick and dirty appc plugin that you can download from the products section here. This plugin is simply a wrapper around the appc utility that simply invokes it directly from a specified WebLogic home location. The plugin also comes with some convenience tools added to make using appc with Maven and Portal easier. For example, the plugin works around another appc limitation that allows only one shared library directory by allowing you to declare multiple shared library directories and concatenating them together before invoking appc.
Anyways more information is available on the products page so go check it out if you are interested. I also added a product page for my weblogic-library-plugin that was included in my original Maven and WebLogic Portal article. This version has been updated with some bug fixes since the article was written. Additionally it includes a new feature added by Kristel Nieuwenhuys that enables you to publish shared libraries to a remote repository.
Posted by Gerald Nunn at 8:58 PM | Categories: WebLogic | Permalink
