Maven WebLogic APPC Plugin

This plugin enables the use of the WebLogic appc (documentation) utility within a Maven project. If you are not familiar with appc, the first line of the previously linked appc documentation summarizes it well "The appc compiler generates and compiles the classes needed to deploy EJBs and JSPs to WebLogic Server".

This plugin represents a pretty quick and dirty implementation to get the WebLogic 10 appc working within Maven, thus it has not been tested with 9.x versions of WebLogic and will very likely not work with 8.1 versions of WebLogic. I had looked at the http://mojo.codehaus.org/weblogic-maven-plugin plugin available here but unfortunately it did not support shared libraries. Another wrinkle in WLS 10 is that weblogic.jar uses the JDK 1.5 extension mechanism to link in additional JARs and unfortunately the weblogic-maven-plugin did not seem to pick these up.

Thus in an effort to get appc working for my WebLogic Portal 10 projects I created this simple plugin. It is a small wrapper around the appc utility with some convenience options for dealing with shared libraries. All this plugin does under the hood is setup the information that appc needs and then build a command line which is dynamically invoked through the maven-exec-plugin.

Here is a description of the configuration parameters for this plugin.

workingDirectoryAn optional parameter specifying the directory to use for temporary files. If not specified the system temporary directory is used.
verboseAn optional paremeter to enable verbose messages, default is false.
weblogicHomeRequired parameter specifying the weblogic home directory. For example C:/bea100/wlserver_10.0. It is recommended this be abstracted into a property in settings.xml.
libraryDirectoriesA list of directories that contain shared libraries to include in appc.
libraryReferencesA list of shared libraries in a maven repository to include in appc. Any libraries referenced here must be declared as a project dependency.
filtersBy default all project dependencies are included when running appc. Under Windows you may have a problem with the command line being too long, this parameter allows you to only include the dependencies you specify here for appc in order to reduce the classpath size.


Here is a sample <plugin> stanza showing how it works:

<plugin>
    <groupId>weblogic-maven</groupId>
    <artifactId>weblogic-appc-plugin</artifactId>
    <version>1.0.0</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>appc</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <!--<workingDirectory>/tmp</workingDirectory>-->
        <weblogicHome>${weblogic.home}</weblogicHome>
        <verbose>true</verbose>
        <libraryDirectories>
            <directory>${weblogic.home}/common/deployable-libraries</directory>
            <directory>${weblogic.home}/portal/lib/modules</directory>
            <directory>${weblogic.home}/cm/lib/modules</directory>
        </libraryDirectories>
        <libraryReferences>
            <library>library.group:library.artifact</library>
        </libraryReferences>
        <filters>
            <filter>org.springframework:spring-context</filter>
            <filter>org.springframework:spring-beans</filter>
            <filter>weblogic-common.beehive-netui:beehive-netui-parent</filter>
            <filter>weblogic-common.p13n-app-lib:p13n-app-lib-parent</filter>
        </filters>
    </configuration>
</plugin>
        

Just to highlight the library references section above, if you include this you must have a dependency to the library in your project as well. For example, assuming the example above of library.group:library.artifact, you would have a dependency as follows:

<dependency>
    <groupId>library.group</groupId>
    <artifactId>library.artifact</artifactId>
    <version>1.0.0</version>
    <type>war</type>
    <scope>provided</scope>
</dependency>
        

Download

Download the plugin source code weblogic-appc-plugin.zip