Skip to content

Commit 3d4e6e7

Browse files
author
TheSnoozer
committed
Merge remote-tracking branch 'upstream/master' into jackson-databind
2 parents f15a8b8 + abae657 commit 3d4e6e7

26 files changed

+136
-83
lines changed

.github/workflows/default-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
name: Deploy snapshot
121121
runs-on: ubuntu-latest
122122
needs: integration-test
123-
if: ${{ github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') }}
123+
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') && github.ref == 'refs/heads/master' }}
124124

125125
steps:
126126
- uses: actions/checkout@v1
@@ -136,3 +136,6 @@ jobs:
136136
restore-keys: ${{ runner.os }}-m2
137137
- name: Deploy snapshot with Maven
138138
run: mvn clean deploy -B --settings=./.buildscript/settings.xml
139+
env:
140+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
141+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For more advanced users we also prepared a [guide to provide a brief overview of
3232

3333
Versions
3434
--------
35-
The current version is **4.0.1** ([changelist](https://github.com/git-commit-id/git-commit-id-maven-plugin/issues?q=milestone%3A4.0.1)).
35+
The current version is **4.0.2** ([changelist](https://github.com/git-commit-id/git-commit-id-maven-plugin/issues?q=milestone%3A4.0.2)).
3636

3737
You can check the available versions by visiting [search.maven.org](https://search.maven.org/artifact/pl.project13.maven/git-commit-id-plugin), though using the newest is obviously the best choice.
3838

core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>pl.project13.maven</groupId>
77
<artifactId>git-commit-id-plugin-parent</artifactId>
8-
<version>4.0.2-SNAPSHOT</version>
8+
<version>4.0.3-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

@@ -17,7 +17,7 @@
1717
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1818
<java.target>1.8</java.target>
1919

20-
<jgit.version>5.2.2.201904231744-r</jgit.version>
20+
<jgit.version>5.8.1.202007141445-r</jgit.version>
2121
<junit.version>4.12</junit.version>
2222
</properties>
2323

@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>joda-time</groupId>
3434
<artifactId>joda-time</artifactId>
35-
<version>2.10.3</version>
35+
<version>2.10.6</version>
3636
</dependency>
3737
<!-- plexus build -->
3838
<dependency>

core/src/main/java/pl/project13/core/GitDataProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ protected SimpleDateFormat getSimpleDateFormatWithTimeZone() {
245245
protected void maybePut(@Nonnull Properties properties, String key, SupplierEx<String> value)
246246
throws GitCommitIdExecutionException {
247247
String keyWithPrefix = prefixDot + key;
248-
if (properties.containsKey(keyWithPrefix)) {
248+
if (properties.stringPropertyNames().contains(keyWithPrefix)) {
249249
String propertyValue = properties.getProperty(keyWithPrefix);
250250
log.info("Using cached {} with value {}", keyWithPrefix, propertyValue);
251251
} else if (PropertiesFilterer.isIncluded(keyWithPrefix, includeOnlyProperties, excludeProperties)) {

core/src/main/java/pl/project13/core/PropertiesFileGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public void maybeGeneratePropertiesFile(@Nonnull Properties localProperties, Fil
6868

6969
final String buildTimeProperty = prefixDot + GitCommitPropertyConstant.BUILD_TIME;
7070

71-
propertiesCopy.remove(buildTimeProperty);
72-
persistedProperties.remove(buildTimeProperty);
71+
propertiesCopy.setProperty(buildTimeProperty, "");
72+
persistedProperties.setProperty(buildTimeProperty, "");
7373

7474
shouldGenerate = !propertiesCopy.equals(persistedProperties);
7575
} catch (CannotReadFileException ex) {

core/src/main/java/pl/project13/core/cibuild/AwsCodeBuildBuildServerData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public static boolean isActiveServer(Map<String, String> env) {
4040
@Override
4141
void loadBuildNumber(@Nonnull Properties properties) {
4242
String buildNumber = env.getOrDefault("CODEBUILD_BUILD_NUMBER", "");
43-
put(properties, GitCommitPropertyConstant.BUILD_NUMBER, buildNumber);
43+
maybePut(properties, GitCommitPropertyConstant.BUILD_NUMBER, () -> buildNumber);
4444

4545
String buildArn = env.get("CODEBUILD_BUILD_ID");
46-
put(properties, GitCommitPropertyConstant.BUILD_NUMBER_UNIQUE, buildArn);
46+
maybePut(properties, GitCommitPropertyConstant.BUILD_NUMBER_UNIQUE, () -> buildArn);
4747
}
4848

4949
@Override

core/src/main/java/pl/project13/core/cibuild/AzureDevOpsBuildServerData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static boolean isActiveServer(@Nonnull Map<String, String> env) {
4141
void loadBuildNumber(@Nonnull Properties properties) {
4242
String buildNumber = env.getOrDefault("BUILD_BUILDNUMBER", "");
4343

44-
put(properties, GitCommitPropertyConstant.BUILD_NUMBER, buildNumber);
44+
maybePut(properties, GitCommitPropertyConstant.BUILD_NUMBER, () -> buildNumber);
4545
}
4646

4747
@Override

core/src/main/java/pl/project13/core/cibuild/BambooBuildServerData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void loadBuildNumber(@Nonnull Properties properties) {
4040
String buildNumber = Optional.ofNullable(env.get("bamboo.buildNumber"))
4141
.orElseGet(() -> env.getOrDefault("BAMBOO_BUILDNUMBER", ""));
4242

43-
put(properties, GitCommitPropertyConstant.BUILD_NUMBER, buildNumber);
43+
maybePut(properties, GitCommitPropertyConstant.BUILD_NUMBER, () -> buildNumber);
4444
}
4545

4646
@Override

core/src/main/java/pl/project13/core/cibuild/BuildServerDataProvider.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import pl.project13.core.util.PropertyManager;
2424

2525
import javax.annotation.Nonnull;
26+
import javax.annotation.Nullable;
2627
import java.net.InetAddress;
2728
import java.net.UnknownHostException;
2829
import java.text.SimpleDateFormat;
@@ -112,8 +113,8 @@ public static BuildServerDataProvider getBuildServerProvider(@Nonnull Map<String
112113
return new UnknownBuildServerData(log, env);
113114
}
114115

115-
public void loadBuildData(@Nonnull Properties properties) {
116-
loadBuildVersionAndTimeData(properties);
116+
public void loadBuildData(@Nonnull Properties properties, @Nullable Date reproducibleBuildOutputTimestamp) {
117+
loadBuildVersionAndTimeData(properties, reproducibleBuildOutputTimestamp);
117118
loadBuildHostData(properties);
118119
loadBuildNumber(properties);
119120
}
@@ -132,9 +133,9 @@ public void loadBuildData(@Nonnull Properties properties) {
132133
*/
133134
public abstract String getBuildBranch();
134135

135-
private void loadBuildVersionAndTimeData(@Nonnull Properties properties) {
136+
private void loadBuildVersionAndTimeData(@Nonnull Properties properties, @Nullable Date reproducibleBuildOutputTimestamp) {
136137
Supplier<String> buildTimeSupplier = () -> {
137-
Date buildDate = new Date();
138+
Date buildDate = (reproducibleBuildOutputTimestamp == null) ? new Date() : reproducibleBuildOutputTimestamp;
138139
SimpleDateFormat smf = new SimpleDateFormat(dateFormat);
139140
if (dateFormatTimeZone != null) {
140141
smf.setTimeZone(TimeZone.getTimeZone(dateFormatTimeZone));
@@ -166,15 +167,9 @@ private void loadBuildHostData(@Nonnull Properties properties) {
166167
maybePut(properties, GitCommitPropertyConstant.BUILD_HOST, buildHostSupplier);
167168
}
168169

169-
protected void put(@Nonnull Properties properties, @Nonnull String key, String value) {
170-
String keyWithPrefix = prefixDot + key;
171-
log.info("Collected {} with value {}", keyWithPrefix, value);
172-
PropertyManager.putWithoutPrefix(properties, keyWithPrefix, value);
173-
}
174-
175170
protected void maybePut(@Nonnull Properties properties, @Nonnull String key, Supplier<String> supplier) {
176171
String keyWithPrefix = prefixDot + key;
177-
if (properties.containsKey(keyWithPrefix)) {
172+
if (properties.stringPropertyNames().contains(keyWithPrefix)) {
178173
String propertyValue = properties.getProperty(keyWithPrefix);
179174
log.info("Using cached {} with value {}", keyWithPrefix, propertyValue);
180175
} else if (PropertiesFilterer.isIncluded(keyWithPrefix, includeOnlyProperties, excludeProperties)) {

core/src/main/java/pl/project13/core/cibuild/CircleCiBuildServerData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static boolean isActiveServer(Map<String, String> env) {
4040
@Override
4141
void loadBuildNumber(@Nonnull Properties properties) {
4242
String buildNumber = env.getOrDefault("CIRCLE_BUILD_NUM", "");
43-
put(properties, GitCommitPropertyConstant.BUILD_NUMBER, buildNumber);
43+
maybePut(properties, GitCommitPropertyConstant.BUILD_NUMBER, () -> buildNumber);
4444
}
4545

4646
@Override

0 commit comments

Comments
 (0)