Skip to content

Commit

Permalink
UP-3835: Adding DB Module, Updating all uportal packaged modules and …
Browse files Browse the repository at this point in the history
…portlets that require the db drivers to leverage the new module
  • Loading branch information
shawnconnolly committed Oct 9, 2013
1 parent 7b88946 commit 0883eeb
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 54 deletions.
50 changes: 50 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
| Properties that describe the maven project
+-->
<property name="bootstrap.dir" value="${basedir}/bootstrap" />
<property name="uportal-db.dir" value="${basedir}/uportal-db" />
<property name="uportal-search-api.dir" value="${basedir}/uportal-search-api" />
<property name="uportal-war.dir" value="${basedir}/uportal-war" />
<property name="uportal-portlets-overlay.dir" value="${basedir}/uportal-portlets-overlay" />
Expand Down Expand Up @@ -1316,6 +1317,33 @@ IMPORTANT: The '-Dpattern=' property is no longer a regular expression and is a
</uportal-parent-macro>
</sequential>
</macrodef>

<!--
| Provides a wrapper for tasks that need a classpath that includes all of the uPortal WAR
| dependencies. The task also ensures the uportal-db artifact exists and is up to date.
|
| The following are available in the search-api-sub-tasks element:
| properties from the uportal-parent-macro macrodef
| pom object - uportal-db.pom - The Maven POM object for the uportal-db pom
| property - uportal-db.artifact - The full path to the uportal-db WAR
| path - uportal-db.classpath - The uportal-db classpath not including the uportal-db WAR
+-->
<macrodef name="uportal-db-macro">
<element name="uportal-db-sub-tasks" optional="false" implicit="true" />

<sequential>
<uportal-parent-macro>
<fileset id="uportal-parent.pom.fsid" file="${basedir}/pom.xml" />

<maven-artifact-macro project-name="uportal-db-api" project-path="${uportal-db.dir}" checkfilesid="uportal-parent.pom.fsid">
<!--
| Execute the uportal-db-sub-tasks
+-->
<uportal-db-sub-tasks />
</maven-artifact-macro>
</uportal-parent-macro>
</sequential>
</macrodef>

<!--
| Provides a wrapper for tasks that need a classpath that includes all of the uPortal WAR
Expand All @@ -1331,6 +1359,28 @@ IMPORTANT: The '-Dpattern=' property is no longer a regular expression and is a
<element name="war-sub-tasks" optional="false" implicit="true" />

<sequential>
<uportal-db-macro>
<fileset id="uportal-parent.pom.fsid" file="${basedir}/pom.xml" />

<maven-artifact-macro project-name="uportal-war" project-path="${uportal-war.dir}" checkfilesid="uportal-parent.pom.fsid">
<artifact:dependencies pathid="uportal-war-classes.classpath" settingsFile="${maven.settings}">
<artifact:dependency groupId="${uportal-war.pom.groupId}" artifactId="${uportal-war.pom.artifactId}" version="${uportal-war.pom.version}" classifier="classes" scope="provided" />
</artifact:dependencies>

<!--
| Include the uportal-war-classes JAR in the final classpath
+-->
<path id="uportal-war-full.classpath">
<path refid="uportal-war-classes.classpath" />
<path refid="uportal-war.classpath" />
</path>

<!--
| Execute the war-sub-tasks
+-->
<war-sub-tasks />
</maven-artifact-macro>
</uportal-db-macro>
<uportal-search-api-macro>
<fileset id="uportal-parent.pom.fsid" file="${basedir}/pom.xml" />

Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@
<!-- The final name of the uPortal web-application -->
<uportal.docbase>uPortal</uportal.docbase>
<project-site-path>/uportal/${project.version}</project-site-path>

<!-- The JDBC Driver used by uPortal -->
<jdbc.groupId>org.hsqldb</jdbc.groupId>
<jdbc.artifactId>hsqldb</jdbc.artifactId>
<jdbc.version>${hsqldb.version}</jdbc.version>

<!--
| Environment name and filters file for environment-specific build
Expand Down
1 change: 1 addition & 0 deletions uportal-db/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
89 changes: 89 additions & 0 deletions uportal-db/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?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</groupId>
<artifactId>uportal-parent</artifactId>
<version>4.1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>uportal-db</artifactId>
<packaging>pom</packaging>

<name>uPortal DB</name>
<description>
The goal of this module is to be able to deploy all the db driver jars to all environments
instead of needing to change parent pom properties and rebuilding for each environment.
The same effect used to be accomplished by manually updating all related poms with hardcoded
dependencies, this module allows for just one place to be updated and the change propogates to all the
packaged modules/portlets.
</description>

<properties>
<hsqldb.version>2.2.9</hsqldb.version>
<!-- <postgre.version>8.3-603.jdbc3</postgre.version> -->
</properties>

<dependencyManagement>
<dependencies>
<!-- Add any db drivers that are applicable to any of your environments -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>compile</scope>
</dependency>
<!-- The following db drivers should be uncommented based on all deployed to environments' db needs
ex. Dev work is done with hsql but the test environment and prod are using postgres, uncomment the postgres
driver dependency with hsql to include them with the other deployed driver jars -->
<!--
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgre.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>another db group id</groupId>
<artifactId>another db artifact id</artifactId>
<version>another db version</version>
<scope>compile</scope>
</dependency>
...
...
-->
</dependencies>
</dependencyManagement>

<dependencies>
<!-- Add any db drivers that are applicable to any of your environments -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
<scope>compile</scope>
</dependency>
<!-- The following db drivers should be uncommented based on all deployed to environments' db needs
ex. Dev work is done with hsql but the test environment and prod are using postgres, uncomment the postgres
driver dependency with hsql to include them with the other deployed driver jars -->
<!--
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgre.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>another db group id</groupId>
<artifactId>another db artifact id</artifactId>
<version>another db version</version>
<scope>compile</scope>
</dependency>
...
...
-->
</dependencies>
</project>
16 changes: 8 additions & 8 deletions uportal-portlets-overlay/AnnouncementsPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
<version>${AnnouncementsPortlet.version}</version>
<type>war</type>
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -100,9 +99,10 @@
</configuration>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
7 changes: 4 additions & 3 deletions uportal-portlets-overlay/BookmarksPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
14 changes: 8 additions & 6 deletions uportal-portlets-overlay/CalendarPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -113,9 +114,10 @@
</executions>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
14 changes: 8 additions & 6 deletions uportal-portlets-overlay/NewsReaderPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -112,9 +113,10 @@
</executions>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
14 changes: 8 additions & 6 deletions uportal-portlets-overlay/SimpleContentPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>

Expand Down Expand Up @@ -103,9 +104,10 @@
</executions>
<dependencies>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
7 changes: 4 additions & 3 deletions uportal-portlets-overlay/WebProxyPortlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
</dependency>

<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
14 changes: 5 additions & 9 deletions uportal-portlets-overlay/cas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
<dependencies>
<!-- ===== Compile Time Dependencies ============================== -->
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>compile</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -146,12 +148,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down
15 changes: 7 additions & 8 deletions uportal-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
<name>uPortal WAR</name>
<description>The uPortal web application.</description>

<dependencies>
<!-- ***** Portal JDBC Driver *****
| The groupId, artifactId and version are configured in the root POM.
+-->
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<dependencies>
<!-- ***** Portal JDBC Driver ***** -->
<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-db</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>

<dependency>
Expand Down

0 comments on commit 0883eeb

Please sign in to comment.