Versions Compared

Key

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

...

  1. Create a new Maven project with the resources you want to add or modify.  At Yale we wanted to include custom xsl and css required by some of our portlets, and to modify jquery-ui-1.7.2-smoothness.css to fix a bug in the accordion menu styles for IE6.  All other resources will be inherited from the Resource Server. We also wanted to override the log4j.properties, to ensure that logging from the resource server complied with our logging standards and that logs were saved in a standard location.
    Code Block
    
    src
      main
    src    resources
      main    log4j.properties
    src
     webapp main
        webapp
      rs    rs
          jqueryui  jqueryui
              1.7.2
                  theme
     
                  smoothness
                      jquery-ui-1.7.2-smoothness.css
              yale
                <custom resources>
    
  2. Create a pom for the project using the maven war plugin overlay functionality to merge the Resource  Server 1.0.3 8 with your project.  Note the exclusion of the .min.css file that is being modified in the custom resource project. 
    Code Block
    
          
    <dependencies>
       
        <!-- ===== Compile Time Dependencies ============================== -->
     	   	<dependency>
    	        		<groupId>org.jasig.resourceserver</groupId>
    	        		<artifactId>resource-server-webapp</artifactId>
    	content<artifactId>
            		<version>1.0.3<8</version>
         	   		<type>war</type>
    	    	</dependency>
    </dependencies>
    
    <build>
        <plugins>
       </dependencies>     <plugin>
    <build>        <plugins>    <groupId>net.sf.alchim</groupId>
            <plugin>    <artifactId>yuicompressor-maven-plugin</artifactId>
                <groupId>net<version>0.sf7.alchim<1</groupId>version>
                <executions>
       <artifactId>yuicompressor-maven-plugin</artifactId>             <execution>
        <version>0.7.1</version>                <goals>
    <executions>                     <execution>   <goal>compress</goal>
                        </goals>
    <goals>                </execution>
                <goal>compress</goal></executions>
                <configuration>
                    <excludes>
                        </goals><exclude>**/*.min.js</exclude>
                        </execution><exclude>**/*.min.css</exclude>
                    </executions>excludes>
                    <linebreakpos>10000</linebreakpos>
               <configuration>     <suffix>.min</suffix>
                </configuration>
      <excludes>      </plugin>
            <plugin>
             <exclude>**/*.min.js</exclude>   <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <exclude>**/*.min.css</exclude><version>2.1-beta-1</version>
                <configuration>
                    <nonFilteredFileExtensions>
                        </excludes>!-- default value contains jpg,jpeg,gif,bmp,png -->
                        <linebreakpos>10000<<nonFilteredFileExtension>jar</linebreakpos>nonFilteredFileExtension>
                        <suffix>.min<<nonFilteredFileExtension>class</suffix>nonFilteredFileExtension>
                    </configuration>nonFilteredFileExtensions>
                    <overlays>
                    </plugin>    <overlay>
           <plugin>                 <groupId>org.apachejasig.maven.plugins<resourceserver</groupId>
                         <artifactId>maven-war-plugin<   <artifactId>resource-server-content</artifactId>
                     <version>2.1-beta-1</version>       <filtered>false</filtered>
                        </overlay>
             <configuration>       </overlays>
                 <nonFilteredFileExtensions>   <dependentWarExcludes>**/jquery-ui-1.7.2-smoothness.min.css</dependentWarExcludes>
                </configuration>
            <!-- default value contains jpg,jpeg,gif,bmp,png -->
     /plugin>
        </plugins>
    </build>
    
  3. Add the custom resource server to your UPortal installation. At Yale, filtering for the framework, portlets, and any other web applications deployed with the portal, including log file location for a given environment (dev, test, prod), occurs during the uPortal build process.  To include the custom resource server, do the following:
    1. Add the ResourceServingWebapp to the uportal-portlets-overlay file structure
      Code Block
      
      uportal-portlets-overlay
        ResourceServingWebapp
          pom.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>
        
    <nonFilteredFileExtension>jar</nonFilteredFileExtension>
    1.       <artifactId>uportal-portlets-overlay-parent</artifactId>
              <version>3.1.1</version>
          </parent>
      
          <modelVersion>4.0.0</modelVersion>
          
    <nonFilteredFileExtension>class<
    1. <artifactId>ResourceServingWebapp</
    nonFilteredFileExtension>
    1. artifactId>
          <packaging>war</packaging>
      
          <name>Resource Server Webapp</name>
          <description>Overlay on Resource Server Webapp.</
    nonFilteredFileExtensions>
    1. description>
      
          <dependencies>
              <!-- ===== Compile Time Dependencies ============================== -->
              <dependency>
           
    <overlays>
    1.  
    1.  
    <overlay>
    1.  
    1.     
    <groupId>org
    1. <groupId>edu.yale.
    jasig
    1. its.
    resourceserver<
    1. portal</groupId>
    1. 
                  
    <artifactId>resource-server-webapp</artifactId>
    1. <artifactId>YaleResources</artifactId>
                  <version>${YaleResources.version}</version>
                   <classifier>unfiltered</classifier>
                  <type>war</type>
              
    <filtered>false</filtered> </overlay>
    1. </dependency>
          </dependencies>
      
          <build>
      
              <filters>
                 
    </overlays>
    1.  <filter>${basedir}/../../src/main/filters/filter-${environment}.properties</filter>
              </filters>
              <plugins>
                  <plugin>
                      
    <dependentWarExcludes>**/jquery-ui-1.7.2-smoothness.min.css</dependentWarExcludes>
    1. <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-war-plugin</artifactId>
                      <version>2.1-beta-1</version>
                      <configuration>
      		    <nonFilteredFileExtensions>
      			<!-- default value contains jpg,jpeg,gif,bmp,png -->
      			<nonFilteredFileExtension>jar</nonFilteredFileExtension>
      			<nonFilteredFileExtension>class</nonFilteredFileExtension>
      		    </nonFilteredFileExtensions>
      		    <overlays>
      			<overlay>
      			    <groupId>edu.yale.its.portal</groupId>
      			    <artifactId>YaleResources</artifactId>
      			    <classifier>unfiltered</classifier>
      			    <filtered>true</filtered>
      			</overlay>
      		    </overlays>
      		</configuration>
                  </plugin>
              
    1. </plugins>
          
    1. </build>
      </project>
      
    2. Add the
    custom resource server to your UPortal installation. code
    1. ResourceServingWebapp to the uportal-portlets-overlay pom.xml modules.
      Code Block
      
      <modules>
         .....
         <module>ResourceServingWebapp</module>
       </modules>