From: Vratko Polak Date: Tue, 8 Nov 2016 15:46:45 +0000 (+0100) Subject: Bug 6003: Create config-filtering-parent X-Git-Tag: release/boron-sr2~1 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=d6e8fdcdbab2f72bd60c3f4f9c150af64748c28d;hp=6d29b2d590148fe6b5645bc29532e4db73f8df45;p=controller.git Bug 6003: Create config-filtering-parent The Bug requests an addition of resource filtering functionality to config-parent. There are several issues with replacing config-parent functionality: - It is a top-level non-karaf feature, subject to API freeze. - maven-resource-plugin operates on directories (as opposed to files). - Users (ODL or otherwise) may change config.file value. + Groovy script can be used to extract directory name... - but it is not easy propagate computed values to sibling plugins. http://stackoverflow.com/questions/21867095/setting-properties-in-maven-with-gmaven - Using two profiles in config-parent does not work easily http://stackoverflow.com/questions/1504850/maven-activate-child-profile-based-on-property (unless creation of temporary files in local filesystem is abused). Therefore, a descendant parent pom is defined in this Change. Presence of ${config.file} activates profiles in both config-parent and config-filtering-parent. Small edits to config-plugin: + Add profile ID to distinguish filtering and non-filtering profiles. Change-Id: Ia9ef770be232e04e4ba73f634a51b50665ee18ab Signed-off-by: Vratko Polak --- diff --git a/opendaylight/config/config-filtering-parent/pom.xml b/opendaylight/config/config-filtering-parent/pom.xml new file mode 100644 index 0000000000..7aec5a27e2 --- /dev/null +++ b/opendaylight/config/config-filtering-parent/pom.xml @@ -0,0 +1,96 @@ + + + + + org.opendaylight.controller + config-parent + 0.5.2-SNAPSHOT + ../config-parent + + + 4.0.0 + org.opendaylight.controller + config-filtering-parent + pom + + + src/main/config + default-config.xml + ${config.dir}/${config.filename} + target/generated-config + ${generated.config.dir}/${config.filename} + + + + + apply-filtering-before-attaching-config + + + ${config.file} + + + + + + + maven-resources-plugin + + + copy-resources + validate + + copy-resources + + + ${generated.config.dir} + + + ${config.dir} + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${generated.config.file} + xml + config + + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + + + + diff --git a/opendaylight/config/config-parent/pom.xml b/opendaylight/config/config-parent/pom.xml index 577978d44f..6c5ae298c3 100644 --- a/opendaylight/config/config-parent/pom.xml +++ b/opendaylight/config/config-parent/pom.xml @@ -177,6 +177,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html + attach-config-without-filtering ${config.file} diff --git a/opendaylight/config/pom.xml b/opendaylight/config/pom.xml index 7ebe5f7ff6..099e019c75 100644 --- a/opendaylight/config/pom.xml +++ b/opendaylight/config/pom.xml @@ -42,6 +42,7 @@ config-artifacts config-parent + config-filtering-parent config-persister-impl config-it-base