uPortal Maven Plugin

The deploy-war goal

The deploy-war goal can be used to deploy a webapp directly to tomcat. Note: this plugin does not plutofy a webapp before deploying it.

Deploying a portlet overlay

The normal process for redeploying a portlet overlay is to run the "ant clean deploy-ear" task, which recompiles and redeploys the portal and all overlays.  Since this process is time-consuming, developers working on an individual portlet may occasionally wish to deploy a single portlet overlay.

To configure the maven-uportal-plugin, add the following block to the plugins section of the overlay pom.xml file.  This configuration assumes that the context name of the deployed webapp should be the same as the artifactId of the built overlay.

Example Plugin Configuration
<plugin>
    <artifactId>maven-uportal-plugin</artifactId>
    <groupId>org.jasig.portal</groupId>
    <version>1.0.0-M4</version>
    <configuration>
        <contextName>${pom.artifactId}</contextName>
        <artifactId>${pom.artifactId}</artifactId>
        <artifactGroupId>${pom.groupId}</artifactGroupId>
        <artifactVersion>${pom.version}</artifactVersion>
        <removeExistingDirectories>true</removeExistingDirectories>
        <extractWars>true</extractWars>
    </configuration>
</plugin>

 

To build the overlay (including filtering, etc.) and redeploy to tomcat, run the following with your desired tomcat path:

mvn clean install org.jasig.portal:maven-uportal-plugin:deploy-war -Dmaven.tomcat.home=/usr/local/tomcat/uportal

If you prefer, you may add the maven.tomcat.home variable to your Maven setttings file or configure it under a profile.

Deploying a portlet

This plugin does not pluto-fy a webapp before deploying it.  If you'd like to use the plugin with local portlet development, you might add an optional profile to your project's pom that performs the portal-version-specific pluto step.

To configure the plugin for local development, add a new profile to your portlet's pom.xml file.  In the example below, we configure the profile to produce a slightly different version of the webapp that is already run through the plutofication process.  This resulting local development war will have JSR-286-specific customizations to the web.xml and cannot be deployed via uPortal's ant deployPortletApp command.  However, it can be deployed directly to a uPortal 4 instance.  By isolating this customization to a profile, we keep the main portlet artifact generic, but can build and deploy the portlet to tomcat with a single command.

Maven pom.xml
    <profiles>
        <profile>
            <id>localdev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.portals.pluto</groupId>
                        <artifactId>maven-pluto-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>assemble</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.1</version>
                        <configuration>
                            <classifier>localdev</classifier>
                            <warName>${project.artifactId}</warName>
                            <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
                            <overlays>
                                <overlay>
                                    <groupId>org.jasig.resourceserver</groupId>
                                    <artifactId>resource-server-content</artifactId>
                                    <includes>
                                        <include>rs/jquery/1.6.1/</include>
                                        <include>rs/jqueryui/1.8.13/</include>
                                        <include>rs/fluid/1.4.0/js</include>
                                    </includes>
                                </overlay>
                            </overlays>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-uportal-plugin</artifactId>
                        <groupId>org.jasig.portal</groupId>
                        <version>1.0.0-M4-SNASHOT</version>
                        <configuration>
                            <contextName>${pom.artifactId}</contextName>
                            <artifactId>${pom.artifactId}</artifactId>
                            <artifactGroupId>${pom.groupId}</artifactGroupId>
                            <artifactVersion>${pom.version}</artifactVersion>
                            <artifactClassifier>localdev</artifactClassifier>
                            <removeExistingDirectories>true</removeExistingDirectories>
                            <extractWars>true</extractWars>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

To build the portlet and deploy it to tomcat, run the following command:

$ mvn clean install org.jasig.portal:maven-uportal-plugin:deploy-war -Plocaldev -Dmaven.tomcat.home=/path/to/my/tomcat