Skip to content

Commit 3b3d985

Browse files
committed
Improve index file invalidation message in Maven plugin
Do not mention plugin fingerprint because it is an implementation detail and can be confusing to users. Explain why index file invalidation could happen.
1 parent 110821e commit 3b3d985

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugin-maven/src/main/java/com/diffplug/spotless/maven/incremental/FileIndex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 DiffPlug
2+
* Copyright 2021-2023 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@ static FileIndex read(FileIndexConfig config, Log log) {
7676
PluginFingerprint computedFingerprint = config.getPluginFingerprint();
7777
PluginFingerprint storedFingerprint = PluginFingerprint.from(firstLine);
7878
if (!computedFingerprint.equals(storedFingerprint)) {
79-
log.info("Fingerprint mismatch in the index file. Fallback to an empty index");
79+
log.info("Index file corresponds to a different configuration of the plugin. Either the plugin version or its configuration has changed. Fallback to an empty index");
8080
return emptyIndexFallback(config);
8181
} else {
8282
Content content = readIndexContent(reader, config.getProjectDir(), log);

plugin-maven/src/test/java/com/diffplug/spotless/maven/incremental/FileIndexTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 DiffPlug
2+
* Copyright 2021-2023 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ void readFallsBackToEmptyIndexOnFingerprintMismatch() throws Exception {
6060
FileIndex index = FileIndex.read(config, log);
6161

6262
assertThat(index.size()).isZero();
63-
verify(log).info("Fingerprint mismatch in the index file. Fallback to an empty index");
63+
verify(log).info("Index file corresponds to a different configuration of the plugin. Either the plugin version or its configuration has changed. Fallback to an empty index");
6464
}
6565

6666
@Test

0 commit comments

Comments
 (0)