Title: fix(run): 支持自定义 Boot 元注解、provided 类路径、构建根 cwd 与 Java 21+ main by 1lck · Pull Request #39 · Lithe-IDEA/lithe-plugin-maven · GitHub
Open Graph Title: fix(run): 支持自定义 Boot 元注解、provided 类路径、构建根 cwd 与 Java 21+ main by 1lck · Pull Request #39 · Lithe-IDEA/lithe-plugin-maven
X Title: fix(run): 支持自定义 Boot 元注解、provided 类路径、构建根 cwd 与 Java 21+ main by 1lck · Pull Request #39 · Lithe-IDEA/lithe-plugin-maven
Description: 关联 Issue / Linked issue
Refs 1lck/Lithe-IDEA#2147(补齐 Maven 多模块默认以构建根为工作目录的一半修复,配合桌面端运行配置保存修复)
改动说明 / Changes
多模块默认工作目录回退到构建根(1lck/Lithe-IDEA#2147)
provider/.../RunPreparation.java:workingDirectory 默认回退从 request.projectPath 改为 request.root(工作区构建根 / 聚合根),与 IntelliJ IDEA 多模块项目习惯一致;用户通过 launchOptions.workingDirectory 显式指定的目录仍然优先覆盖。
扩展 Spring Boot 组合注解与跨模块自定义 @interface 元注解识别
extension/.../Applications.java、ModelExport.java、RunExport.java:
Applications.customBootAnnotations 在有限文件/字节配额内扫描反应堆所有模块的编译源码根,通过定点闭包传递识别基于 @SpringBootApplication、@SpringCloudApplication 或 @EnableAutoConfiguration 定义的自定义 @interface 元注解。
Applications.annotatedClass 同时识别 @SpringBootApplication、@SpringCloudApplication、跨模块自定义 Boot @interface(严格尊重 import / 同包作用域解析),以及带有效非 private/非 abstract main 方法的 @EnableAutoConfiguration 类;永远不把 @interface 注解定义本身列为 runnable target。
RunExport 同步补充 SpringCloudApplication、EnableAutoConfiguration 与自定义 @interface JVM 字节码描述符识别(在编译产物存在多个 main 时正确优选 Boot 启动类),并在类头显式排除 @interface(ACC_ANNOTATION)。
Spring Boot 与 WAR 运行纳入 provided 作用域依赖
extension/.../LitheLifecycleParticipant.java、RunExport.java 与 provider/.../RunPreparation.java:
新增可选属性 lithe.runIncludeProvided。RunExport.shouldIncludeProvided 在显式指定时以其为准,否则对 packaging == "war" 或配置了 spring-boot-maven-plugin 的模块自动包含 provided 作用域运行时类路径(仍排除 test 并去重)。
RunPreparation 在准备 spring-boot 目标且用户未通过 optionArguments 显式覆盖 -Dlithe.runIncludeProvided 时默认传 -Dlithe.runIncludeProvided=true,使内嵌容器或以 provided 引入的 API/容器依赖不再启动报 ClassNotFoundException/NoClassDefFoundError。
支持 Java 21+/25 main() 入口与紧凑源文件识别
provider/.../RunEntrypoints.java:支持无参 void main()、实例 void main(String[])、static void main(String...)、throws 声明及无 package/class 头的 Java 21+/25 紧凑源文件(CompactMain.java 等),并拒绝 private/abstract/接口 default 方法与 @interface。
extension/.../RunExport.java:字节码层面识别非 private/非 abstract 的 main()V 与 main([Ljava/lang/String;)V(接口与抽象类仍要求 ACC_STATIC),排除 @interface 类文件。
文档与集成测试
更新 README.md 与 docs/feature-matrix.md 对入口识别、provided 类路径与工作目录默认值的说明。
更新 scripts/test.mjs:修正多模块服务默认 workingDirectory 为 "." 并验证显式覆盖,新增 verifyExtendedBootAndProvided 覆盖跨模块传递自定义 @interface、@SpringCloudApplication、@EnableAutoConfiguration(含/不含 main)、provided 依赖默认包含及 -Dlithe.runIncludeProvided=false 覆盖、普通 jar 排除 provided、以及 Java 21+ void main() / 紧凑源文件(文本与 Java 8 编译字节码)与 private main() 拒绝。
验证 / Verification
检查项
环境
结果
node scripts/sdk/verify-sdk.mjs
macOS arm64
通过
node scripts/package.mjs
macOS arm64 / JDK 17 (--release 8) / Maven 3.9.14
通过,生成全平台可移植归档
node scripts/test-process.mjs
macOS arm64
9/9 通过
node --test --test-timeout=60000 scripts/package/*.test.mjs scripts/compiler/process.test.mjs
macOS arm64
5 passed, 1 skipped (Windows-only batch test)
node scripts/compiler/test.mjs
macOS arm64
5/5 通过
MAVEN_ARGS="-s
Open Graph Description: 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#2147(补齐 Maven 多模块默认以构建根为工作目录的一半修复,配合桌面端运行配置保存修复) 改动说明 / Changes 多模块默认工作目录回退到构建根(1lck/Lithe-IDEA#2147) provider/.../RunPreparation.java:workingDirect...
X Description: 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#2147(补齐 Maven 多模块默认以构建根为工作目录的一半修复,配合桌面端运行配置保存修复) 改动说明 / Changes 多模块默认工作目录回退到构建根(1lck/Lithe-IDEA#2147) provider/.../RunPreparation.java:workingDirect...
Opengraph URL: https://github.com/Lithe-IDEA/lithe-plugin-maven/pull/39
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f64a87d4-fae8-93e8-b4e3-70860ad804ed |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E27C:1E92DF:23796D:312D27:6B0743ED |
| html-safe-nonce | f6e20a81c9ea1a8c845046525d30dc9ff48199b9109a61b3bb6d1f340b186599 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjdDOjFFOTJERjoyMzc5NkQ6MzEyRDI3OjZCMDc0M0VEIiwidmlzaXRvcl9pZCI6IjU0Nzc1NjM4ODE0ODI2NTk2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6e0748a7fca21844ea9baf22e9dc573e9324610eacb6036254c9ec254174b46e |
| hovercard-subject-tag | pull_request:5408017177 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/Lithe-IDEA/lithe-plugin-maven/pull/39/files |
| twitter:image | https://avatars.githubusercontent.com/u/159525154?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/159525154?s=400&v=4 |
| og:image:alt | 关联 Issue / Linked issue Refs 1lck/Lithe-IDEA#2147(补齐 Maven 多模块默认以构建根为工作目录的一半修复,配合桌面端运行配置保存修复) 改动说明 / Changes 多模块默认工作目录回退到构建根(1lck/Lithe-IDEA#2147) provider/.../RunPreparation.java:workingDirect... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e906c59266d83416af9bcc8b61b9a96e70a3a84a066bd24f6671c193dd134a04 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/Lithe-IDEA/lithe-plugin-maven git https://github.com/Lithe-IDEA/lithe-plugin-maven.git |
| octolytics-dimension-user_id | 340144206 |
| octolytics-dimension-user_login | Lithe-IDEA |
| octolytics-dimension-repository_id | 1424417765 |
| octolytics-dimension-repository_nwo | Lithe-IDEA/lithe-plugin-maven |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1424417765 |
| octolytics-dimension-repository_network_root_nwo | Lithe-IDEA/lithe-plugin-maven |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a8418b8cd1f6ecc99bee02e3f7dde540702dd08c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width