1. 项目构建
2. 遇到过得的问题
解决办法:1.通过: windows菜单 -> show view/other 菜单 -> other菜单 在弹出的窗口中,搜索 Problems窗口。 2.然后运行程序/或者在Problems窗口中,你会发现 红色的警告,这些就是反映的错误,修复它们,即可。
解决办法: 1.进入本地仓库的repository\org\apache\maven\plugins文件下
2.删除所有plugin
3.重启eclipse
4.重新clean 、install
原因:maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常 解决办法: 1.将webroot修改为webapp 2.在pom.xml中指定web.xml,如下:
<build> <finalName>web-app-name</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> <configuration> <webXml>webapp\WEB-INF\web.xml</webXml> </configuration> </plugin> </plugins> </build>经历了反复的clean-build、maven force update及各种可能想得到的操作,某些依赖包依然无法下载。 解决办法:在settings.xml中加入如下代码
<mirrors> <mirror> <id>nexus</id> <mirrorOf>central</mirrorOf> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> </mirrors>原因:hibernate.hql是对类进行查询的 解决办法:纠正hql语句,将表名改为类名,EMPLOYEES是表名,Employee是类名,所以要改成 session.createQuery(“from Employee”).list().iterator();
**
setting加入如下配置 **
<mirrors> <mirror> <id>nexus</id> <name>internal nexus repository</name> <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>--> <url>http://repo.maven.apache.org/maven2</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>