Versions Compared

Key

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

...

Code Block
# Should the deployment tools extract the WARs when copying them into the servlet container

extractWars=true

Adding Portlets to uPortal's Portlet Overlays

...

To add a portlet to the uPortal build as an overlay, first create a folder inside uPortal-3.2.x/uportal-portletportlets-overlaysoverlay. If I were adding the Jasig Announcements portlet to the overlay, I might name the folder "Announcements". Next, create a POM file for this portlet.

...

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-3.2.x/uportal-portletportlets-overlaysoverlay/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>

Add the overlay as a dependency of the uportal-ear 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">

    . . .

    <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>

...