licenseHeader.content gets the © symbol turned to ?? in CI, but not locally
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- build-system, ci-cd
Hướng nghiên cứu
Bắt đầu bằng cách so sánh cấu hình Spotless của POM và môi trường CI khi chạy goal spotless:check của Maven. Kiểm tra output được báo cáo của src/test/java/com/uuu/ccc/common/test/util/TransformTest.java và cấu hình debug, sau đó xác minh rằng header giấy phép © vẫn nhất quán ở local và trong CI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 5.7k
- Fork
- 560
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 43
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của diffplug/spotless
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Tất cả issue của diffplug/spotless
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·