Versions Compared

Key

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

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. The PostgreSQL example below can be followed for any JDBC driver that can be found in the central Maven repository, this includes most open source JDBC drivers. The Oracle example below can be followed for any JDBC driver that cannot be found in the central Maven repository, this includes most closed-source JDBC drivers.

Example using PostgreSQL

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 readsinformation is configured in the <properties> block about 90 lines down in a section that looks like:

Code Block
xml
xml
<!-- ***** Portal The JDBC Driver *****used by | 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. 
 +uPortal -->
<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>

...

<jdbc.groupId>hsqldb</jdbc.groupId>
<jdbc.artifactId>hsqldb</jdbc.artifactId>
<jdbc.version>1.8.0.7</jdbc.version>

The database specific examples listed on 05 Database provide detailed instructions for this process.