Wrong classpath with Gradle `compileOnly` like instructions
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, spring-boot, vscode
- Lĩnh vực
- build-system, devtools
Hướng nghiên cứu
Tái hiện dự án với dependency compileOnly được nêu, đồng thời so sánh ./gradlew bootRun với cấu hình khởi chạy Java trong .vscode/launch.json. Truy vết classpath được lắp ráp cho lần khởi chạy VS Code và các lần chạy kiểm thử; được xem là hoàn tất khi các dependency compileOnly vẫn khả dụng trong quá trình biên dịch nhưng vắng mặt khi chạy, phù hợp với hành vi của Gradle.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We need to use the compileOnly in a gradle modules.
The expected behaviour is to have the dependency available at the compile time, but not at runtimes.
It's useful to create spring boot auto-configurations that load only if the dependency is present in the consumer module.
We have this declaration in a library:
dependencies {
compileOnly 'org.springframework.boot:spring-boot-starter-security'
}
In the application module we have this declaration:
dependencies {
implementation project(':libs:my-lib')
}
Running the following command, the project works as expected. The spring-boot-starter-security is not loaded.
./gradlew bootRun
But if we run the following configuration, the dependency is in classpath at runtime and the auto-configuration is applied at wrong.
{
"configurations": [
{
"type": "java",
"name": "Spring Boot-Application",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.mycompany.Application",
"projectName": "application",
"args": ""
}
]
}
There is also dependency problems in test but I can't exactly explain what. There is some BeanDefinitionOverrideException that are not present running the ./gradlew test command.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 547
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
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 redhat-developer/vscode-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
redhat-developer/vscode-java#4426 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
redhat-developer/vscode-java#4506 · 3 bình luận · 4 reaction ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
redhat-developer/vscode-java#4505 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
redhat-developer/vscode-java#4504 · 3 bình luận · 1 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
redhat-developer/vscode-java#4502 ·
Tất cả issue của redhat-developer/vscode-java
Issue tương tự
-
comp/dashboard P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·