ZBLOG

java: Annotation processing is not supported for module cycles. Please ensure that all modules from cycle [data-operation-third-feign,data-operation-common] are excluded from annotation processing怎么解决

这个错误是因为在 Java 9 及以上版本中,模块化的引入导致了一些限制。当两个或多个模块互相依赖时,会形成一个循环依赖关系,称为模块循环。在这种情况下,注释处理不被支持。

要解决这个问题,你需要确保所有涉及到循环依赖的模块都被排除在注释处理之外。可以通过添加以下选项来实现:

--limit-modules <module>[,<module>...]

其中 <module> 是指那些不能被注释处理的模块名称列表。在你的情况下,应该将 data-operation-third-feigndata-operation-common 这两个模块添加到列表中:

--limit-modules data-operation-third-feign,data-operation-common

如果你使用的是 Maven,则可以将此选项添加到 pom.xml 文件中的编译器插件配置中:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${maven.compiler.plugin.version}</version>
    <configuration>
        <compilerArgs>
            <arg>--limit-modules</arg>
            <arg>data-operation-third-feign,data-operation-common</arg>
        </compilerArgs>
    </configuration>
</plugin>

如果你使用 Gradle,则可以将此选项添加到 build.gradle 文件中的编译器参数配置中:

compileJava {
    options.compilerArgs += ["--limit-modules", "data-operation-third-feign,data-operation-common"]
}

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=3660

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?