Maven不支持lombok的问题
程序员文章站
2022-07-13 09:08:07
...
工程基于Maven,使用到了Lombok,编译时提示以下错误导致找不到Lombok库而编译通不过。
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.wp:demo:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.scope' for org.projectlombok:lombok:jar must be one of [provided, compile, runtime, test, system] but is 'annotationProcessor'. @ line 37, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
解决方法:在pom.xml中,修改Lombok的依赖,
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>annotationProcessor</scope>
</dependency>
将<scope>annotationProcessor</scope>改为<scope>provided</scope>
推荐阅读
-
关于maven依赖关系的问题
-
lombok安装的步骤和常见问题
-
解决nginx不支持thinkphp中pathinfo的问题
-
关于 Safari 浏览器不支持 location [ window.location.href window.open()] 跳转问题的解决方案
-
关于Intellij idea 报错:Error : java 不支持发行版本5的问题
-
永久解决 Intellij idea 报错:Error :java 不支持发行版本5的问题
-
maven添加oracle依赖失败问题的处理方法
-
IDEA下Maven的pom文件导入依赖出现Auto build completed with errors的问题
-
Activiti系列:如何把Activiti工程转换为maven工程以解决依赖项找不到的问题
-
解决jquery1.9不支持browser对象的问题