babyfish-ct / jimmer

A revolutionary ORM framework for both java and kotlin.
Apache License 2.0
715 stars 72 forks source link

org.babyfish.jimmer.apt.JimmerProcessor是否支持JDK17和JDK21 #625

Closed ooknight closed 1 month ago

ooknight commented 1 month ago

使用8以上版本JDK编译时会有警告 [WARNING] 来自批注处理程序 'org.babyfish.jimmer.apt.JimmerProcessor' 的受支持 source 版本 'RELEASE_8' 低于 -source '21' 是否可以修改或去掉注解@SupportedSourceVersion(SourceVersion.RELEASE_8)以消除警告

babyfish-ct commented 1 month ago

支持

这个问题暂时不敢动,目前国内Java8用户太多

babyfish-ct commented 1 month ago

可以试试去掉那个人注解

babyfish-ct commented 1 month ago

Try 0.8.155

ooknight commented 1 month ago

只去掉注解会提示这两个警告 [WARNING] No SupportedSourceVersion annotation found on org.babyfish.jimmer.apt.JimmerProcessor, returning RELEASE_6. [WARNING] 来自批注处理程序 'org.babyfish.jimmer.apt.JimmerProcessor' 的受支持 source 版本 'RELEASE_6' 低于 -source '21'

我看网上的解决方案是不用 @SupportedSourceVersion 注解,然后重写 AbstractProcessor 的 getSupportedSourceVersion 方法

mapstruct 代码

@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latestSupported();
}

ebean 代码

@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}

@babyfish-ct