Skip to content

Commit

Permalink
Drop timestamp from version string/product id info
Browse files Browse the repository at this point in the history
  • Loading branch information
pzygielo committed Jun 13, 2023
1 parent c805d45 commit 7ca3968
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ product.name=${product.name}
product.name.abbreviation=${product.name.abbreviation}
product.version=${project.version}
product.build.git.commit=${git.commit.id.full}
product.build.timestamp=${git.build.time}

admin.command.name=${admin.command.name}

Expand Down
6 changes: 3 additions & 3 deletions appserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<jakarta.interceptor-api.version>2.1.0</jakarta.interceptor-api.version>

<!-- Jakarta Security + Authentication/Authorization -->
<soteria.version>3.0.3</soteria.version>
<soteria.version>3.0.2</soteria.version>
<exousia.version>2.1.0</exousia.version>
<nimbus.version>9.31</nimbus.version>
<jcip.version>1.0.2</jcip.version>
Expand Down Expand Up @@ -159,9 +159,9 @@
<omnifaces-jwt-auth.version>2.0.1</omnifaces-jwt-auth.version>

<!-- Admin console components -->
<jsftemplating.version>4.0.2</jsftemplating.version>
<jsftemplating.version>4.0.1</jsftemplating.version>
<jsf-ext.version>0.2</jsf-ext.version>
<woodstock.version>6.0.1</woodstock.version>
<woodstock.version>6.0.0</woodstock.version>
<woodstock-dataprovider.version>1.0</woodstock-dataprovider.version>
<woodstock-dojo-ajax-nodemo.version>1.12.4</woodstock-dojo-ajax-nodemo.version>
<woodstock-json.version>2.0</woodstock-json.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

/**
Expand Down Expand Up @@ -72,12 +71,8 @@ public void versionAfterShutdown() {

private void checkOutput(String output) throws MultipleFailuresError {
assertThat(output,
stringContainsInOrder("Version = Eclipse GlassFish ", "commit: ", ", timestamp: "));
String commit = StringUtils.substringBetween(output, "commit: ", ",");
String timestamp = StringUtils.substringBetween(output, ", timestamp: ", ")");
assertAll(
() -> assertThat(commit, matchesPattern("[a-f0-9]+")),
() -> assertDoesNotThrow(() -> Instant.parse(timestamp))
);
stringContainsInOrder("Version = Eclipse GlassFish ", "commit: "));
String commit = StringUtils.substringBetween(output, "commit: ", ")");
assertThat(commit, matchesPattern("[a-f0-9]+"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,6 @@ The meaning of each keyword-value pair is as follows:
Returns the product version. It should follow standard form `major.minor.patch[-suffix]`
`product.build.git.commit=ec1ce24934f0bb174333a9886b58a0d2f9e52b44`::
Specifies the git commit, used for the build.
`product.build.timestamp=2023-02-27T11:09:42Z`::
Specifies the build timestamp.

[[ghrfh]]
Example 4-4 `glassfish-version.properties` File for Changing the Brand in
Expand All @@ -955,7 +953,6 @@ product.name=Eclipse GlassFish
product.name.short=GF
product.version=7.0.3-SNAPSHOT
product.build.git.commit=93176e2555176091c8522e43d1d32a0a30652d4a
product.build.timestamp=2023-02-27T11:09:42Z
domain.template.defaultJarFileName=appserver-domain.jar
admin.command.name=asadmin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class Version {
private static final String KEY_PRODUCT_NAME_ABBREVIATION = "product.name.abbreviation";
private static final String KEY_PRODUCT_VERSION = "product.version";
private static final String KEY_GIT_COMMIT = "product.build.git.commit";
private static final String KEY_BUILD_TIMESTAMP = "product.build.timestamp";
private static final String KEY_BASED_ON = "based.on";

private static final String KEY_ADMIN_COMMAND_NAME = "admin.command.name";
Expand All @@ -62,7 +61,6 @@ public class Version {
private static final int VERSION_PATCH;

private static final String COMMIT;
private static final Instant BUILD_TIMESTAMP;

static {
PRODUCT_NAME = getProperty(KEY_PRODUCT_NAME, "GlassFish");
Expand Down Expand Up @@ -106,8 +104,6 @@ public class Version {
VERSION_RELEASE = Integer.toString(VERSION_MAJOR) + '.' + Integer.toString(VERSION_MINOR) + '.'
+ Integer.toString(VERSION_PATCH);
COMMIT = getProperty(KEY_GIT_COMMIT, null);
String timestamp = getProperty(KEY_BUILD_TIMESTAMP, null);
BUILD_TIMESTAMP = timestamp == null ? null : Instant.parse(timestamp);
}


Expand Down Expand Up @@ -137,12 +133,12 @@ public static String getProductId() {
/**
* @return
* <pre>
* Eclipse GlassFish 7.0.0-SNAPSHOT (commit: 93176e2555176091c8522e43d1d32a0a30652d4a, timestamp: 2023-02-24T18:24:00Z)
* Eclipse GlassFish 7.0.0-SNAPSHOT (commit: 93176e2555176091c8522e43d1d32a0a30652d4a)
* </pre>
*/
public static String getProductIdInfo() {
return getProductName() + " " + getVersion() + " (commit: " + COMMIT
+ ", timestamp: " + BUILD_TIMESTAMP + ")";
+ ")";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void parse() {
() -> assertEquals("Wonderful GlassFish 2023.2.27", Version.getProductId()),
() -> assertEquals(
"Wonderful GlassFish 2023.2.27-SNAPSHOT ("
+ "commit: 93176e2555176091c8522e43d1d32a0a30652d4a, timestamp: 2023-02-27T11:09:42Z)",
+ "commit: 93176e2555176091c8522e43d1d32a0a30652d4a)",
Version.getProductIdInfo()),
() -> assertEquals("Wonderful GlassFish", Version.getProductName()),
() -> assertEquals("WGF", Version.getProductNameAbbreviation()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ product.name=Wonderful GlassFish
product.name.abbreviation=WGF
product.version=2023.2.27-SNAPSHOT
product.build.git.commit=93176e2555176091c8522e43d1d32a0a30652d4a
product.build.timestamp=2023-02-27T11:09:42Z

admin.command.name=myOwnAsAdmin

Expand Down
1 change: 0 additions & 1 deletion nucleus/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@
<dateFormatTimeZone>UTC</dateFormatTimeZone>
<commitIdGenerationMode>full</commitIdGenerationMode>
<includeOnlyProperties>
<includeOnlyProperty>git.build.time</includeOnlyProperty>
<includeOnlyProperty>git.commit.id.full</includeOnlyProperty>
</includeOnlyProperties>
</configuration>
Expand Down

0 comments on commit 7ca3968

Please sign in to comment.