diffplug / diffplug/spotless

licenseHeader.content gets the © symbol turned to ?? in CI, but not locally

Aperta
#2,266 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug-unconfirmed
Lingua principale
Java
Stelle
5.6k
Fork
559
Merge medio
1g 14h
PR unite (30g)
43

Descrizione

When I run the spotless maven plugin `check` goal locally, it goes through fine. But in CI, specifically Jenkins, I always get errors:

```
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:check (default) on project ccc-reuse: The following files had format violations:
[ERROR] src/test/java/com/uuu/ccc/common/test/util/TransformTest.java
[ERROR] @@ -2,7 +2,7 @@
[ERROR] ·*·OCO·Source·Materials
[ERROR] -·*·©·Copyright·UUU·2008-2024.·All·Rights·Reserved.
[ERROR] +·*·??·Copyright·UUU·5655.·All·Rights·Reserved.
```

If I replace the `©` in `licenseHeader.content` with `©` - it behaves the same, just that it turns the symbol into a single `?` instead of two.

I understand that this is some environment issue, but looking at it - the maven versions are the same, java versions the same. `LANG`, `LC_ALL`, `LANGUAGE` variables are the same.

Running maven with `-X` it also shows that it reads the pom like that in CI:
```
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: com.diffplug.spotless:spotless-maven-plugin:2.43.0:check (default)
[DEBUG] Style: Regular
[DEBUG] Configuration:

${spotless.apply.skip}


${spotless.check.skip}
UTF-8
${spotlessFiles}





/*******************************************************************************
* OCO Source Materials
* ? Copyright UUU $YEAR. All Rights Reserved.
*
* The source code for this program is not published or otherwise
* divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*******************************************************************************/
(/(/|\*{1,2}[^*])|package|import|public|final|abstract|class|enum|interface)





${spotlessSetLicenseHeaderYearsFromGitHistory}
${spotless.skip}

```

but it shows up properly when run locally. I tried adding the UTF8 BOM to the POM, but it didn't help. Otherwise it is UTF8 encoded.

Maven 3.9.9. Spotless 2.43.0.
CI is running in a Ubuntu 24.04.1 LTS docker container running on a CentOS Stream 8 host.

Does anyone have any ideas what could be the issue here?

Spotless configuration:
```xml

com.diffplug.spotless
spotless-maven-plugin






/*******************************************************************************
* OCO Source Materials
* © Copyright UUU $YEAR. All Rights Reserved.
*
* The source code for this program is not published or otherwise
* divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*******************************************************************************/

(/(/|\*{1,2}[^*])|package|import|public|final|abstract|class|enum|interface)

UTF-8




check

compile




```

- [x] summary of problem
- [x] Gradle or Maven version
- [x] spotless version
- [x] operating system and version
- [x] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- [x] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace`

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia confrontando la configurazione Spotless del POM e l’ambiente CI durante l’esecuzione dell’obiettivo spotless:check di Maven. Esamina l’output segnalato di src/test/java/com/uuu/ccc/common/test/util/TransformTest.java e la configurazione di debug, quindi verifica che l’intestazione di licenza © rimanga coerente localmente e in CI.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
build-system, ci-cd
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.