Uploaded image for project: 'odlparent'
  1. odlparent
  2. ODLPARENT-309

Rework odl-karaf-feat-jdbc feature to be more lightweight

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • General

      The odl-karaf-feat-jdbc feature imports all 21 features from the org.ops4j.pax.jdbc feature.xml file. However, from the definitions in odl-karaf-feat-jdbc feature.xml, we actually require only 3 of them: [pax-jdbc-spec, pax-jdbc, pax-jdbc-config]. The inclusion of unnecessary features not only increases the weight of the ODL distribution but also introduces security concerns.

      The ODL Persistence project utilizes its own version of pax-jdbc, which is independent of the odlparent version. Also, they are not using latest odlparent version:
      https://github.com/opendaylight/persistence/blob/master/features/src/main/resources/features.xml#L12

      The ODL Transportpce use pax-jdbc-mariadb and pax-jdbc-pool-dbcp2:
      https://github.com/opendaylight/transportpce/blob/8.1.0/features/odl-transportpce-inventory/src/main/feature/feature.xml

       

      So, we don't really need to provide all pax-jdbc features.

      Proposal solution:

      1. Create an ODL feature "karaf-feat-jdbc-spec" with the "template-feature-parent" as its parent. This feature will include only the "pax-jdbc-spec" in its "feature.xml".
      2. Refactor "odl-karaf-feat-jdbc" to utilize "template-feature-parent" as its parent. Change the packaging from "karaf" to "feature". Eliminate dependencies on pax-jdbc-features and replace them with pax-jdbc, pax-jdbc-config and karaf-feat-jdbc-spec.
      3. Refactor the feature.xml to include only "pax-jdbc" and "pax-jdbc-config". (Use the template-feature-parent to define the version in the pom rather than in the .xml file)
        <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0" name="odl-karaf-feat-jdbc">
            <feature name="pax-jdbc" description="Provides JDBC Service support" version="1.5.6">
                <feature>pax-jdbc-spec</feature>
        
                <bundle>mvn:org.ops4j.pax.jdbc/pax-jdbc/1.5.6</bundle>
            </feature>
        
            <feature name="pax-jdbc-config" description="Provides JDBC Config support" version="1.5.6">
                <feature>pax-jdbc-spec</feature>
        
                <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt/1.9.3_1</bundle>
                <bundle>mvn:org.ops4j.pax.jdbc/pax-jdbc-pool-common/1.5.6</bundle>
                <bundle>mvn:org.ops4j.pax.jdbc/pax-jdbc-config/1.5.6</bundle>
            </feature>
            <feature name="odl-karaf-feat-jdbc" version="${project.version}">
                <feature prerequisite="true">pax-jdbc</feature>
                <feature prerequisite="true">pax-jdbc-config</feature>
            </feature>
        </features>
      1. (Optionaly) Create features for pax-jdbc-mariadb and pax-jdbc-pool-dbcp2, or allow Transportpce to create them on its own.

            PeterSuna Peter Suna
            PeterSuna Peter Suna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: