From 9251cb4f43a277aa30b0ba0b79444b18f69f84e5 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Mon, 15 Sep 2014 15:24:06 +0000 Subject: QPID-6101: Allow setting of qpid version suffix whilst building qpid common library git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1625062 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/common/build-generate-sources.xml | 26 +----------------- qpid/java/common/pom.xml | 31 +++++++++++++++++++++- .../org/apache/qpid/common/QpidProperties.java | 7 ++++- .../src/main/resources/qpidversion.properties | 23 ++++++++++++++++ 4 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 qpid/java/common/src/main/resources/qpidversion.properties (limited to 'qpid/java/common') diff --git a/qpid/java/common/build-generate-sources.xml b/qpid/java/common/build-generate-sources.xml index 339887f3dd..cd88bfecb1 100644 --- a/qpid/java/common/build-generate-sources.xml +++ b/qpid/java/common/build-generate-sources.xml @@ -27,7 +27,6 @@ - @@ -50,29 +49,6 @@ - - - - - - - - - - - - - - - - - - qpid.version=${project.version} -qpid.svnversion=${svnversion.output} -qpid.name=qpid - - @@ -110,6 +86,6 @@ qpid.name=qpid - + diff --git a/qpid/java/common/pom.xml b/qpid/java/common/pom.xml index e3cf9cadd7..4ba6713a6c 100644 --- a/qpid/java/common/pom.xml +++ b/qpid/java/common/pom.xml @@ -33,7 +33,10 @@ ${basedir}/src/main/java ${basedir}/src/main/java ${basedir}/src/main/java/org/apache/qpid/filter/selector - ${project.build.directory}/classes/qpidversion.properties + qpid + ${project.version} + + Unversioned directory @@ -54,6 +57,14 @@ + + + + src/main/resources + true + + + ${basedir}/src/test/java @@ -67,6 +78,24 @@ + + org.codehaus.mojo + buildnumber-maven-plugin + 1.3 + + + validate + + create + + + + + false + false + + + org.apache.maven.plugins maven-antrun-plugin diff --git a/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java b/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java index 25baf86fe6..cdd44d3443 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java @@ -58,6 +58,9 @@ public class QpidProperties /** Defines the name of the version property. */ public static final String RELEASE_VERSION_PROPERTY = "qpid.version"; + /** Defines the name of the version suffix property. */ + public static final String RELEASE_VERSION_SUFFIX = "qpid.version.suffix"; + /** Defines the name of the source code revision property. */ public static final String BUILD_VERSION_PROPERTY = "qpid.svnversion"; @@ -101,7 +104,9 @@ public class QpidProperties } productName = readPropertyValue(props, PRODUCT_NAME_PROPERTY); - releaseVersion = readPropertyValue(props, RELEASE_VERSION_PROPERTY); + String versionSuffix = (String) props.get(RELEASE_VERSION_SUFFIX); + String version = readPropertyValue(props, RELEASE_VERSION_PROPERTY); + releaseVersion = versionSuffix == null || "".equals(versionSuffix) ? version : version + ";" + versionSuffix; buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY); } } diff --git a/qpid/java/common/src/main/resources/qpidversion.properties b/qpid/java/common/src/main/resources/qpidversion.properties new file mode 100644 index 0000000000..1fc575368a --- /dev/null +++ b/qpid/java/common/src/main/resources/qpidversion.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +qpid.name=${qpid.name} +qpid.version=${qpid.version} +qpid.version.suffix=${qpid.version.suffix} +qpid.svnversion=${buildNumber} \ No newline at end of file -- cgit v1.2.1