Repository navigation
fix(run): 支持自定义 Boot 元注解、provided 类路径、构建根 cwd 与 Java 21+ main - #39
Merged
Merged
Conversation
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
改动说明 / Changes
provider/.../RunPreparation.java:workingDirectory默认回退从request.projectPath改为request.root(工作区构建根 / 聚合根),与 IntelliJ IDEA 多模块项目习惯一致;用户通过launchOptions.workingDirectory显式指定的目录仍然优先覆盖。@interface元注解识别extension/.../Applications.java、ModelExport.java、RunExport.java:Applications.customBootAnnotations在有限文件/字节配额内扫描反应堆所有模块的编译源码根,通过定点闭包传递识别基于@SpringBootApplication、@SpringCloudApplication或@EnableAutoConfiguration定义的自定义@interface元注解。Applications.annotatedClass同时识别@SpringBootApplication、@SpringCloudApplication、跨模块自定义 Boot@interface(严格尊重 import / 同包作用域解析),以及带有效非private/非abstractmain方法的@EnableAutoConfiguration类;永远不把@interface注解定义本身列为 runnable target。RunExport同步补充SpringCloudApplication、EnableAutoConfiguration与自定义@interfaceJVM 字节码描述符识别(在编译产物存在多个main时正确优选 Boot 启动类),并在类头显式排除@interface(ACC_ANNOTATION)。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。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.mjsnode scripts/package.mjs--release 8) / Maven 3.9.14node scripts/test-process.mjsnode --test --test-timeout=60000 scripts/package/*.test.mjs scripts/compiler/process.test.mjsnode scripts/compiler/test.mjsMAVEN_ARGS="-s <blank-settings.xml>" node scripts/test.mjs注:上述 Java 代码全部严格兼容 Java 8 编译与运行(CI
Maven 3.6.3 + Java 8矩阵校验将在本 PR CI 运行)。