java - Spring MVC工程,无报错,但部分注解标红色报错
阿神
阿神 2017-04-18 10:26:26
0
9
510

要给公司做个小项目,上手Java没多久,发现配置个IDE真的是处处是坑。

问题描述

IDE是Intellij Ultimat 2016.3版本,从git导入项目后一切正常,导入无报错,gradle无报错。并且已安装lombok plugin,已enable “annotation processor”。但是部分注解仍是红色报错,如下图。

问了下其他同事,他们的配置跟我一样但是没出现这个问题。有没有踩过此坑的大神来救命~

提前跪谢。

阿神
阿神

闭关修行中......

reply all(9)
洪涛

Solved because the configuration file settings in the project are unreasonable. When importing gradle, you cannot choose to read the configuration file of each module, otherwise it will be repeated.

伊谢尔伦

The spring package is not referenced, maybe the package version conflicts. It is recommended to redirect the package

伊谢尔伦

The jar package is not imported correctly.

洪涛

Configure the library in the project configuration

刘奇

See the maker panel at a glance

洪涛

First check whether the spring package under External Libraries is there. If there is still an error, add indexes again; if it still doesn’t work, it is better to add the spring jar package in your local maven repository as Global Libraries

迷茫

Built with gradle? It is recommended to rewrite your build.gradle file and find all the Spring dependencies in mvnrepository.com

伊谢尔伦

In the dependencies of the module in the project structure, check if there are any spring-related packages (in your case, there should be none). If not, you can make it manually; if you use gradle, you can depend on spring-related packages in build.gradle, and then depend on spring-related packages in module.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!