From d55371e9b773fe7434526a0312fabb5d4eefd981 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Sat, 4 Oct 2014 14:35:01 +0200 Subject: [PATCH] [Minor] fixed component version descriptions --- .../li/strolch/agent/api/AgentVersion.java | 2 +- .../strolch/agent/api/ComponentVersion.java | 2 +- .../strolch/agent/api/StrolchComponent.java | 2 +- ...stractVersion.java => StrolchVersion.java} | 37 +++++++++++-------- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- .../resources/componentVersion.properties | 2 +- 11 files changed, 32 insertions(+), 25 deletions(-) rename li.strolch.agent/src/main/java/li/strolch/agent/api/{AbstractVersion.java => StrolchVersion.java} (71%) diff --git a/li.strolch.agent/src/main/java/li/strolch/agent/api/AgentVersion.java b/li.strolch.agent/src/main/java/li/strolch/agent/api/AgentVersion.java index 4dc7b4d4c..3c71388b7 100644 --- a/li.strolch.agent/src/main/java/li/strolch/agent/api/AgentVersion.java +++ b/li.strolch.agent/src/main/java/li/strolch/agent/api/AgentVersion.java @@ -27,7 +27,7 @@ import javax.xml.bind.annotation.XmlRootElement; */ @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "AgentVersion") -public class AgentVersion extends AbstractVersion { +public class AgentVersion extends StrolchVersion { @XmlAttribute(name = "agentName") private String agentName; diff --git a/li.strolch.agent/src/main/java/li/strolch/agent/api/ComponentVersion.java b/li.strolch.agent/src/main/java/li/strolch/agent/api/ComponentVersion.java index 7c73b8fe2..86e400575 100644 --- a/li.strolch.agent/src/main/java/li/strolch/agent/api/ComponentVersion.java +++ b/li.strolch.agent/src/main/java/li/strolch/agent/api/ComponentVersion.java @@ -27,7 +27,7 @@ import javax.xml.bind.annotation.XmlRootElement; */ @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement(name = "ComponentVersion") -public class ComponentVersion extends AbstractVersion { +public class ComponentVersion extends StrolchVersion { @XmlAttribute(name = "componentName") private String componentName; diff --git a/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchComponent.java b/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchComponent.java index 7052a832d..51257e518 100644 --- a/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchComponent.java +++ b/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchComponent.java @@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory; public class StrolchComponent { - private static final String COMPONENT_VERSION_PROPERTIES = "/componentVersion.properties"; //$NON-NLS-1$ + public static final String COMPONENT_VERSION_PROPERTIES = "/componentVersion.properties"; //$NON-NLS-1$ protected static final Logger logger = LoggerFactory.getLogger(StrolchComponent.class); private final ComponentContainer container; private final String componentName; diff --git a/li.strolch.agent/src/main/java/li/strolch/agent/api/AbstractVersion.java b/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchVersion.java similarity index 71% rename from li.strolch.agent/src/main/java/li/strolch/agent/api/AbstractVersion.java rename to li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchVersion.java index 098dbc3aa..f352d6289 100644 --- a/li.strolch.agent/src/main/java/li/strolch/agent/api/AbstractVersion.java +++ b/li.strolch.agent/src/main/java/li/strolch/agent/api/StrolchVersion.java @@ -25,35 +25,42 @@ import javax.xml.bind.annotation.XmlAttribute; * @author Robert von Burg */ @XmlAccessorType(XmlAccessType.NONE) -public abstract class AbstractVersion { +public class StrolchVersion { - @XmlAttribute(name = "groupId") + public static final String BUILD_TIMESTAMP = "buildTimestamp"; + public static final String SCM_BRANCH = "scmBranch"; + public static final String SCM_REVISION = "scmRevision"; + public static final String ARTIFACT_VERSION = "artifactVersion"; + public static final String ARTIFACT_ID = "artifactId"; + public static final String GROUP_ID = "groupId"; + + @XmlAttribute(name = GROUP_ID) private String groupId; - @XmlAttribute(name = "artifactId") + @XmlAttribute(name = ARTIFACT_ID) private String artifactId; - @XmlAttribute(name = "artifactVersion") + @XmlAttribute(name = ARTIFACT_VERSION) private String artifactVersion; - @XmlAttribute(name = "scmRevision") + @XmlAttribute(name = SCM_REVISION) private String scmRevision; - @XmlAttribute(name = "scmBranch") + @XmlAttribute(name = SCM_BRANCH) private String scmBranch; - @XmlAttribute(name = "buildTimestamp") + @XmlAttribute(name = BUILD_TIMESTAMP) private String buildTimestamp; - public AbstractVersion() { + public StrolchVersion() { // no-arg constructor for JAXB } /** * @param properties */ - public AbstractVersion(Properties properties) { - this.groupId = properties.getProperty("groupId"); //$NON-NLS-1$ - this.artifactId = properties.getProperty("artifactId"); //$NON-NLS-1$ - this.artifactVersion = properties.getProperty("artifactVersion"); //$NON-NLS-1$ - this.scmRevision = properties.getProperty("scmRevision"); //$NON-NLS-1$ - this.scmBranch = properties.getProperty("scmBranch"); //$NON-NLS-1$ - this.buildTimestamp = properties.getProperty("buildTimestamp"); //$NON-NLS-1$ + public StrolchVersion(Properties properties) { + this.groupId = properties.getProperty(GROUP_ID); //$NON-NLS-1$ + this.artifactId = properties.getProperty(ARTIFACT_ID); //$NON-NLS-1$ + this.artifactVersion = properties.getProperty(ARTIFACT_VERSION); //$NON-NLS-1$ + this.scmRevision = properties.getProperty(SCM_REVISION); //$NON-NLS-1$ + this.scmBranch = properties.getProperty(SCM_BRANCH); //$NON-NLS-1$ + this.buildTimestamp = properties.getProperty(BUILD_TIMESTAMP); //$NON-NLS-1$ } /** diff --git a/li.strolch.model/src/main/resources/componentVersion.properties b/li.strolch.model/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.model/src/main/resources/componentVersion.properties +++ b/li.strolch.model/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.persistence.postgresql/src/main/resources/componentVersion.properties b/li.strolch.persistence.postgresql/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.persistence.postgresql/src/main/resources/componentVersion.properties +++ b/li.strolch.persistence.postgresql/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.persistence.xml/src/main/resources/componentVersion.properties b/li.strolch.persistence.xml/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.persistence.xml/src/main/resources/componentVersion.properties +++ b/li.strolch.persistence.xml/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.rest/src/main/resources/componentVersion.properties b/li.strolch.rest/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.rest/src/main/resources/componentVersion.properties +++ b/li.strolch.rest/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.service/src/main/resources/componentVersion.properties b/li.strolch.service/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.service/src/main/resources/componentVersion.properties +++ b/li.strolch.service/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.tutorialapp/src/main/resources/componentVersion.properties b/li.strolch.tutorialapp/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.tutorialapp/src/main/resources/componentVersion.properties +++ b/li.strolch.tutorialapp/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.tutorialwebapp/src/main/resources/componentVersion.properties b/li.strolch.tutorialwebapp/src/main/resources/componentVersion.properties index 1f050160f..a4594a250 100644 --- a/li.strolch.tutorialwebapp/src/main/resources/componentVersion.properties +++ b/li.strolch.tutorialwebapp/src/main/resources/componentVersion.properties @@ -1,6 +1,6 @@ groupId=${project.groupId} artifactId=${project.artifactId} artifactVersion=${project.version} -scmRevision=r${buildNumber} +scmRevision=${buildNumber} scmBranch=${scmBranch} buildTimestamp=${buildTimestamp} \ No newline at end of file