licenseHeader.content gets the © symbol turned to ?? in CI, but not locally
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- java
- 領域
- build-system, ci-cd
調査の方向性
まず、Maven の spotless:check ゴールの実行時における POM の Spotless 設定と CI 環境を比較します。報告された src/test/java/com/uuu/ccc/common/test/util/TransformTest.java の出力とデバッグ設定を調査し、その後、© ライセンスヘッダーがローカルと CI で一貫していることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<applySkip default-value="false">${spotless.apply.skip}</applySkip>
<baseDir default-value="${project.basedir}"/>
<buildDir default-value="${project.build.directory}"/>
<checkSkip default-value="false">${spotless.check.skip}</checkSkip>
<encoding default-value="UTF-8">UTF-8</encoding>
<filePatterns>${spotlessFiles}</filePatterns>
<goal default-value="${mojoExecution.goal}"/>
<java>
<palantirJavaFormat/>
</java>
<licenseHeader>
<content>/*******************************************************************************
* 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.
*******************************************************************************/</content>
<delimiter>(/(/|\*{1,2}[^*])|package|import|public|final|abstract|class|enum|interface)</delimiter>
</licenseHeader>
<lineEndings default-value="GIT_ATTRIBUTES_FAST_ALLSAME"/>
<project default-value="${project}"/>
<repositories default-value="${project.remotePluginRepositories}"/>
<repositorySystemSession default-value="${repositorySystemSession}"/>
<setLicenseHeaderYearsFromGitHistory>${spotlessSetLicenseHeaderYearsFromGitHistory}</setLicenseHeaderYearsFromGitHistory>
<skip default-value="false">${spotless.skip}</skip>
</configuration>
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:
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<java>
<palantirJavaFormat/>
</java>
<licenseHeader>
<content>
/*******************************************************************************
* 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.
*******************************************************************************/
</content>
<delimiter>(/(/|\*{1,2}[^*])|package|import|public|final|abstract|class|enum|interface)</delimiter>
</licenseHeader>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
- summary of problem
- Gradle or Maven version
- spotless version
- operating system and version
- copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- copy-paste the full content of any console errors emitted by
gradlew spotless[Apply/Check] --stacktrace
- 主要言語
- Java
- スター
- 5.7k
- フォーク
- 560
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/spotless のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
diffplug/spotless の issue をすべて見る
似ている issue
-
certification
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's オープンbug ecr
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Needs: Triage Type: Feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/copilot-sdk#2760 ·