redhat-developer / redhat-developer/vscode-java
Custom gradle configurations are not properly picked up
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
Details
We have a module which generates JOOQ sources and compiles them into java classes.
The module also contains some classes under a/src/main/java which help to produce the JOOQ sources as part of the compileJava task.
So we have something like this in our A module:
val generatedDbDataJar: Configuration by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
extendsFrom(configurations["implementation"], configurations["runtimeOnly"])
}
And in our B module we have something like this which consumes it:
implementation(project(mapOf("path" to ":A")))
implementation(project(mapOf("path" to ":A", "configuration" to "generatedDbDataJar")))
This setup works absolutely fine if you run ./gradlew build, in Eclipse and in IntelliJ.
However, in Cursor or VSCode the setup above does not work and the produced classes are not recognized in module B and are showing as "missing" classes in the IDE.
It looks to us like this is a bug, unless there's a specific configuration for this case?
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.
Hướng nghiên cứu
Bắt đầu bằng cách tái tạo thiết lập hai module với generatedDbDataJar configuration của module A và project dependencies của module B, sau đó so sánh ./gradlew build với việc import trong VS Code hoặc Cursor. Truy vết cách Java extension xử lý custom Gradle configurations và xác minh rằng generated classes từ A được resolve trong B; hoàn thành có nghĩa là các classes đó được nhận diện mà không có lỗi IDE.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, vscode
- Lĩnh vực
- build-system, developer-experience
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100