Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

uPortal uses Maven for dependency management. To add your JDBC driver you need to know the Maven groupId, artifactId and version for the JAR and add this information to the /uPortal/uportal-impl/pom.xml file. There is a section about 20 lines down from the top with instructions pertaining to JDBC drivers.

Example using

...

The first step is to determine the correct information to use in the pom. Using a Maven Artifact Search Site and searching for "postgres" we find the following Maven dependency declaration here.

...


<dependency>
    <groupId>postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>8.2-507.jdbc4</version>
</dependency>

Opening /uPortal/uportal-impl/pom.xml there is a section about 20 lines down that reads:

...


<!-- ***** Portal JDBC Driver *****
 | Add your JDBC Driver dependency here. If you are not using hsqldb you must change the scope
 | to test instead of just removing it as the driver is required for unit tests. 
 +-->
<dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>${hsqldb.version}</version>
    <scope>compile</scope>
</dependency>

We will add the PostgreSQL driver here and do as the comment says and change the <scope> tag of the hsqldb driver to test.

...


<!-- ***** Portal JDBC Driver *****
 | Add your JDBC Driver dependency here. If you are not using hsqldb you must change the scope
 | to test instead of just removing it as the driver is required for unit tests. 
 +-->
<dependency>
    <groupId>postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>8.2-507.jdbc4</version>
</dependency>

<dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>${hsqldb.version}</version>
    <scope>test</scope>
</dependency>

Save the changes to /uPortal/uportal-impl/pom.xml and run "ant deploy-war" to deploy uPortal with your JDBC driver.

Example using Oracle

Since the Oracle JDBC driver is not available in the central Maven repository it must be placed into the local repository on each machine you wish to build uPortal on. An alternative to installing the JAR on each machine you can setup a local maven repository for use by multiple machines.

...