Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The uPortal "ant deployPortletApp" task is designed to apply the appropriate modifications for the version of Pluto that uPortal 3.2 uses, then deploy the updated portlet war to the appropriate Tomcat location.

Code Block

ant deployPortletApp -DportletApp=/path/to/my/portlet.war

If you'd like to make sure any existing matching portlet application is deleted before being redeployed, please set the value of "removeExisting" in uPortal's build.properties file to "false"true" (this is the default value).

Code Block

# Should the existing webapp be removed before deploying the new webapp
removeExisting=falsetrue

You can also choose whether the ant task will extract the war file while copying it to the servlet container. To perform extraction, set "extractWars" in uPortal's build.properties file to "true".

Code Block

# Should the deployment tools extract the WARs when copying them into the servlet container 
extractWars=true

...

In the top level of the portlet, create a file named "pom.xml". This file will use the main portal pom as its parent and use the portal's version as its version. The project will declare the desired portlet as a dependency. The groupId and artifactId of the dependency should match those of the project itself. The artifactId for the module can be whatever you'd like, but it's easiest to make it the same as the project.

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.jasig.portal.portlets-overlay</groupId>
        <artifactId>uportal-portlets-overlay-parent</artifactId>
        <version>3.2.5-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>Announcements</artifactId>
    <packaging>war</packaging>

    <name>Announcements Portlet</name>
    <description>Overlay on Bookmarks Portlet.</description>

    <dependencies>
        <!-- ===== Compile Time Dependencies ============================== -->
        <dependency>
            <groupId>org.jasig.portlet</groupId>
            <artifactId>Announcements</artifactId>
            <version>${AnnouncementsPortlet.version}</version>
            <type>war</type>
        </dependency>
        
        <dependency>
            <groupId>${jdbc.groupId}</groupId>
            <artifactId>${jdbc.artifactId}</artifactId>
            <version>${jdbc.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>
           <plugin>
                <groupId>org.apache.pluto</groupId>
                <artifactId>maven-pluto-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

Add a property named "AnnouncementsPortlet.version" to the main uPortal pom file. This will allow the version to be easily updated in the future. To do this, open uPortal/pom.xml and locate the <properties/> element. Add a new property to indicate the version of the Announcements portlet:

Code Block
xml
xml
     <properties>

        . . .

        <!-- WAR Dependency Version Properties -->
        . . .
        <AnnouncementsPortlet.version>1.1-M1</AnnouncementsPortlet.version>
        . . .
    </properties>

The new overlay needs to be added to the overlays project pom as a module. Open uPortal/uportal-portlet-overlays/pom.xml and add your new folder as a dependency:

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    . . . 

    <modules>
        <module>BookmarksPortlet</module>
        . . .
        <module>Announcements</module>
    </modules>

    . . . 

</project>

...

Once you've created your new overlay, it needs to be added to the uportal ear file. To do this, add the new module as a dependency in uportal/uportal-ear/pom.xml:

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    . . .

    <dependencies>

        . . .
        
        <dependency>
            <groupId>org.jasig.portal.portlets-overlay</groupId>
            <artifactId>Announcements</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>

        . . .
    </dependencies>        

    <build>
        <finalName>${uportal.docbase}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-ear-plugin</artifactId>
                <configuration>
                    <modules>
                        . . .
                        <webModule>
                            <groupId>org.jasig.portal.portlets-overlay</groupId>
                            <artifactId>Announcements</artifactId>
                            <bundleFileName>Announcements.war</bundleFileName>
                            <contextRoot>/Announcements</contextRoot>
                        </webModule>
                    </modules>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

...