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:
- 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".
- 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.
- 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>
- (Optionaly) Create features for pax-jdbc-mariadb and pax-jdbc-pool-dbcp2, or allow Transportpce to create them on its own.
- blocks
-
AAA-277 Replace odl-karaf-feat-jdbc feature with ODL features
- Open
- relates to
-
ODLPARENT-306 Exclude Apache Derby from build
- Resolved
-
ODLPARENT-311 Bump Derby to 10.17.x
- Open