From 77cb41dffaddc61981eb13376cdd3ce277f6b851 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 12 Oct 2014 10:32:04 +0200 Subject: [PATCH] Introduce features-builder The planned rework of version handling requires the features artifacts to stop relying on maven properties for versions. This patch introduces a base pom (e.g. suitable for being a parent), which provides the versioning functionality based of dependency tree. The user will typically use features-builder as their parent pom, activate the plugins mentioned in pluginManagement and provide a template features file, where the required version is marked by a {{VERSION}} placeholder. The location of this template is hard-coded to src/features, but the file name is controlled by features.file property (features.xml) by default. The build process' plugin wiring will take care of processing the template and looking through the artifact's dependency tree. If a required version is not found, the build is forced to fail. Change-Id: If3252ffe8ca2b099ffd10c1cc37b47b3a1ac7698 Signed-off-by: Tony Tkacik Signed-off-by: Robert Varga --- common/features-builder/pom.xml | 250 ++++++++++++++++++++++++++++++++ common/pom.xml | 1 + 2 files changed, 251 insertions(+) create mode 100644 common/features-builder/pom.xml diff --git a/common/features-builder/pom.xml b/common/features-builder/pom.xml new file mode 100644 index 0000000000..0576893ad4 --- /dev/null +++ b/common/features-builder/pom.xml @@ -0,0 +1,250 @@ + + + + + 4.0.0 + + org.opendaylight.odlparent + odlparent + 1.5.0-SNAPSHOT + + + org.opendaylight.yangtools + features-builder + pom + 0.7.0-SNAPSHOT + + + features.xml + + + + + + src/main/resources + true + + + + + + + + maven-dependency-plugin + + + generate-resources + resolve + + ${project.build.directory}/dependencies.txt + + + + + + com.alexecollins.maven.plugin + script-maven-plugin + 1.0.0 + + + add-version-to-features + generate-resources + + execute + + + groovy + + + + + + + org.codehaus.groovy + groovy + 1.8.6 + + + + + org.apache.karaf.tooling + karaf-maven-plugin + ${karaf.version} + true + + + features-create-kar + + features-create-kar + + + ${project.build.directory}/classes/${features.file} + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + generate-resources + add-resource + + + + ${project.build.directory}/generated-resources/script + true + + + + + + attach-artifacts + package + + attach-artifact + + + + + ${project.build.directory}/classes/${features.file} + xml + features + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter + generate-resources + + resources + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.opendaylight.yangtools:features-test + + + + + + + + + + + org.opendaylight.yangtools + features-test + 0.7.0-SNAPSHOT + test + + + diff --git a/common/pom.xml b/common/pom.xml index f9a2d2423f..a2e57da7e9 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -26,6 +26,7 @@ checkstyle-logging concepts features + features-builder features-test mockito-configuration object-cache-api -- 2.36.6