當(dāng)Intellij IDEA升級(jí)到2020.3版本時(shí),如果你的項(xiàng)目恰恰使用了Lombok示姿,那么恭喜你甜橱,十有八九會(huì)中招,在編譯的時(shí)候產(chǎn)生如下錯(cuò)誤:
java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
? Your processor is: org.jetbrains.jps.javac.$Proxy18
? Lombok supports: sun/apple javac 1.6, ECJ
但是Maven卻可以正常構(gòu)建栈戳。
根據(jù)IntelliJ的說(shuō)法這是因?yàn)長(zhǎng)ombok導(dǎo)致的岂傲,而且拒絕在IDEA側(cè)解決,需要等Lombok升級(jí)荧琼,具體撕逼內(nèi)容如下:
https://youtrack.jetbrains.com/issue/IDEA-252069
雖然我對(duì)于他們這種神仙打架的行為很好奇譬胎,也樂意觀看差牛,但是我還得搬磚啊。上面的鏈接中也給出了解決方案堰乔,就是在編譯的命令行參數(shù)中加入-Djps.track.ap.dependencies=false偏化,具體位置如下:
再次編譯,順利通過镐侯。
追加:
項(xiàng)目中如果有在使用MapStruct侦讨,那么在升級(jí)到IntelliJ IDEA 2020.3 EAP時(shí), 也會(huì)產(chǎn)生如下錯(cuò)誤:
java: Internal error in the mapping processor:?
java.lang.NullPointerException
at org.mapstruct.ap.internal.processor.DefaultVersionInformation.createManifestUrl(DefaultVersionInformation.java:182)
at org.mapstruct.ap.internal.processor.DefaultVersionInformation.openManifest(DefaultVersionInformation.java:153)
at org.mapstruct.ap.internal.processor.DefaultVersionInformation.getLibraryName(DefaultVersionInformation.java:129)
at org.mapstruct.ap.internal.processor.DefaultVersionInformation.getCompiler(DefaultVersionInformation.java:122)
at org.mapstruct.ap.internal.processor.DefaultVersionInformation.fromProcessingEnvironment(DefaultVersionInformation.java:95)
at org.mapstruct.ap.internal.processor.DefaultModelElementProcessorContext.<init>(DefaultModelElementProcessorContext.java:50)
at org.mapstruct.ap.MappingProcessor.processMapperElements(MappingProcessor.java:218)
at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:156)
at org.jetbrains.jps.javac.APIWrappers$ProcessorWrapper.process(APIWrappers.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at org.jetbrains.jps.javac.APIWrappers$1.invoke(APIWrappers.java:213)
at org.mapstruct.ap.MappingProcessor.process(Unknown Source)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856) at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:231)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:496)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:348)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:272)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:226)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1441)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1100)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1224)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1066)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:832)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:419)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:183)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:132)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:132)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:219)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
解決方法同上苟翻,就是加入編譯參數(shù)-Djps.track.ap.dependencies=false韵卤。