Regression in Gradle plugin v8.3.0: Cannot set the value of task ':integTest:spotlessJava' property 'taskService'

Đang mở
#2,877 3 bình luận 10 reaction 0 người được giao Xem trên GitHub

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
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với lần chạy GitHub Actions được liên kết và thiết lập multi-project được mô tả trong issue, tập trung vào build.gradle.kts root còn thiếu và project integTest. So sánh lỗi này với workaround apply-false, sau đó xác định xem behavior của plugin hay documentation có nên thay đổi hay không. Hoàn thành khi thiết lập không còn thất bại nếu không dùng workaround, hoặc yêu cầu mới được document rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

See https://github.com/tbroyer/gradle-incap-helper/actions/runs/23116714774/job/67143450577?pr=53.

Caused by: java.lang.IllegalArgumentException: Cannot set the value of task ':integTest:spotlessJava' property 'taskService' of type com.diffplug.gradle.spotless.SpotlessTaskService loaded with InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-integTest(export)}) using a provider of type com.diffplug.gradle.spotless.SpotlessTaskService loaded with InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-incap(export)}).
This can be caused by a plugin being applied to two sibling projects and then using a shared build service. To fix this, use `@ServiceReference` or add the problematic plugin with `apply false` to the root build script.

This happens in a multi-project build where the root project doesn't have a build.gradle.kts, so the spotless plugin isn't applied on the root project; and indeed adding it with apply false works around the error.

Either this should be documented as a new requirement, or the plugin should use @ServiceReference (if that makes a difference; but then also require Gradle >= 8)

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của diffplug/spotless

Tất cả issue của diffplug/spotless

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.