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. There is a section about 20 lines down from the top with instructions pertaining to JDBC drivers.

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.

The first step is to download the correct Oracle JDBC driver for your database. Once you have the jar it needs to be installed into your local maven repository using the following command:

No Format

mvn install:install-file -DgroupId= -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -DgeneratePom=true -Dfile=ojdbc14-10.2.0.3.0.jar

The groupId, artifactId and version specified in this command are up to you but they should match the JAR vendor, name and version to avoid confusion down the road.

Opening /uPortal/uportal-impl/pom.xml there is a section about 20 lines down that readsThe information 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 Oracle driver here using the group, artifact and version information from the mvn install:install-file command above 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>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.3.0</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.