maven项目的pom.xml文件不识别$符号标红, 引入mapstruct报错
错误一:
在IntelliJ IDEA中, maven项目的pom.xml文件不识别$符号,,
解决方案:
删除项目,从新从gitlab上下载。
可能因为缓存,但是我清理了缓存仍然无用。最后删除重新下载。
错误二:
由于引入:mapstruct-processor,
报错:java: Internal error in the mapping processor: java.lang.NullPointerException
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:206) 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:362) 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:239) at org.jetbrains.jps.javac.ExternalJavacProcess.compile(ExternalJavacProcess.java:189) at org.jetbrains.jps.javac.ExternalJavacProcess.access$400(ExternalJavacProcess.java:28) at org.jetbrains.jps.javac.ExternalJavacProcess$CompilationRequestsHandler$1.run(ExternalJavacProcess.java:262) 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)
解决方案:
Idea设置: Setting -->Build,Execution,Deployment -->Compiler -->User-local build process VM options (overrides Shared options):
加上参数:
-Djps.track.ap.dependencies=false
错误三:
由于引入:mapstruct-processor,
编译报错:java: Internal error in the mapping processor: java.lang.OutOfMemoryError: GC overhead limit exceeded
java: Internal error in the mapping processor: java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.Arrays.copyOf(Arrays.java:3181) at java.util.ArrayList.toArray(ArrayList.java:380) at java.util.ArrayList.addAll(ArrayList.java:581) at org.mapstruct.ap.internal.model.source.selector.TypeSelector.getCandidateParameterBindingPermutations(TypeSelector.java:272) at org.mapstruct.ap.internal.model.source.selector.TypeSelector.getMatchingMethods(TypeSelector.java:67) at org.mapstruct.ap.internal.model.source.selector.MethodSelectors.getMatchingMethods(MethodSelectors.java:62) at org.mapstruct.ap.internal.model.LifecycleMethodResolver.collectLifecycleCallbackMethods(LifecycleMethodResolver.java:140) at org.mapstruct.ap.internal.model.LifecycleMethodResolver.afterMappingMethods(LifecycleMethodResolver.java:67) at org.mapstruct.ap.internal.model.BeanMappingMethod$Builder.build(BeanMappingMethod.java:222) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMappingMethods(MapperCreationProcessor.java:376) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.getMapper(MapperCreationProcessor.java:151) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:122) at org.mapstruct.ap.internal.processor.MapperCreationProcessor.process(MapperCreationProcessor.java:76) at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:283) at org.mapstruct.ap.MappingProcessor.processMapperTypeElement(MappingProcessor.java:263) at org.mapstruct.ap.MappingProcessor.processMapperElements(MappingProcessor.java:221) at org.mapstruct.ap.MappingProcessor.process(MappingProcessor.java:156) 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:239) at org.jetbrains.jps.javac.ExternalJavacProcess.compile(ExternalJavacProcess.java:189) at org.jetbrains.jps.javac.ExternalJavacProcess.access$400(ExternalJavacProcess.java:28) at org.jetbrains.jps.javac.ExternalJavacProcess$CompilationRequestsHandler$1.run(ExternalJavacProcess.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
解决方案:
Idea设置: Setting -->Build,Execution,Deployment -->Compiler -->User-local build process heap size(Mbytes):2048
默认是700.