From: Vratko Polak Date: Tue, 23 Aug 2016 17:14:09 +0000 (+0200) Subject: Bug 6003: Create config-filtering-parent X-Git-Tag: release/carbon~487 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=befcfeb2be24a87a972d53587b464e7c427caad8 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..7a88ed08da --- /dev/null +++ b/opendaylight/config/config-filtering-parent/pom.xml @@ -0,0 +1,96 @@ + + + + + org.opendaylight.controller + config-parent + 0.6.0-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 d2468726b5..87e3dcfe2f 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 bb7e56c828..4ff15167d5 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