今天将maven重新装了一遍,发现以前的许多问题就没有再出现了,所以,当你用maven的时候发现问题比较多,搞不定的时候,建议重新安装一遍。因为maven是个自动标准化的东西,很多东西不好改动,重装是比较好的选择。安装和集成myeclipse2015的教程,可以参考下面的链接,但是我只试过安装maven和集成2015的步骤,其他的步骤不确定是不是正确的,慎用。链接如下:
http://blog.sina.com.cn/s/blog_9ad12ac20102vzlo.html
下面把自己遇到的问题的解决方法分享给大家,有用的话可以点个赞,还不知道csdn的赞有啥用~~:
1.json文件报错
如果是导入的项目,一般文件内容是不会错的,应该是校验的问题。
Window > Preferences > MyEclipse > Validation > 右侧将“JSON Validator”关闭即可。
2.Class “xxxx” is managed, but is not listed in the persistence.xml file
JPA的问题,本质原因是:JPA项目会用JPA的规则进行验证,所以就会报错。右键persistence.xml file,找到JPA tools,Synchronize Class List.实在不行,只能忽略看看:Select: (Your Project) -> Properties -> JPA;
eclipse下: Look for “Persistent class management” and select the option “Discover annotated classes automatically”;
myeclipse2015下:jpa下的type,找到class is managed
3.terget entity “xxx” is not an Entity
问题本质同:class “xxx” is managed,but it is not listed in persistence.xml
在JPA中修改
4.cvc-complex-type.2.4.a:invalid content
解决办法为:将“http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd”这段话加入到xml文件的”xmlns:xsi=”的标签中
转自:http://blog.csdn.net/niu_hao/article/details/25250213
cvc-complex-type.2.4.c
可能是网络问题,还没遇到过
5.install时无法失败:Could not resolve dependencies for project com.
install是有顺序的,先parent
6。jar:0.0.1-SNAPSHOT is missing, no dependency information available
同5
- Referenced file contains errors(xxx)。括号内的问题分两种:一种直接提示到本地路径的,一直提示www的。
本地的:直接进入将对应的xsd删除(如果不行可以尝试:打开Preferences -> General -> Network Connections -> Cache,清除缓存,重启,重新maven-update project)
www的:一般是有空格,这里一般是写法不规范引起的,建议将每个www都回车分行
8.Could not find artifact xxx
一般是maven下载失败导致,我这边比较常见的是jdbc导不下来。
Properties-java build path-maven dependencies 找到包,重新下,或从别人哪里拷贝。
其他一些我没遇到的过的问题可以参考:http://blog.csdn.net/heweirun_2014/article/details/46558329