diffplug / diffplug/spotless

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

Open
#2,266 2 comments 0 reactions 0 assignees View on GitHub
bug-unconfirmed
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.