文档库 最新最全的文档下载
当前位置:文档库 › maven新建项目报错解决方案

maven新建项目报错解决方案

1.web.xml is missing and is set to true[解决]
选择 “Deployment Descriptor”

选择 : Generate Deployment Descriptor Stub

产生 WEB-INF 文件夹和 web.xml 文件

方法二:https://www.wendangku.net/doc/4a5422022.html,/hundan_520520/article/details/53763887

即可解决问题


1、更新eclipse的classpath加入新依赖
1、在dependencyManagement里面加入包括版本在内的依赖信息,如:

joda-time
joda-time
1.6.2

2、在同级的
dependencies
节点里面加入该依赖,如:

joda-time
joda-time

3、使用mvn eclipse:clean删除当前的工程配置文件,并用mvn eclipse:eclipse重新生成。
4、导入或刷新该eclipse工程。


2、工程配置未使用pom.xml更新问题:
Project configuration is not up-to-date with pom.xml 导入maven工程后,出现如下错误:
Description Resource Path Location Type Project configuration is not up-to-date with pom.xml. Run project configuration update rdc line 1 Maven Configuration Problem
解决办法就是:
右键项目,【Maven】--》【Update Project Configuration...】即可。。。

3、如何修改默认GBK的资源过滤Using platform encoding (GBK actually) to copy filtered resources 需要指定字符集:

org.apache.maven.plugins
maven-resources-plugin
2.2

UTF-8


4、不支持范型的JDK版本问题maven打包时始终出现TripApplyAction.java:[267,6]-source 1.3中不支持泛型(请使用-source 5或更高版 本以启用泛型)Map map = new HashMap(); 解决方法,指定JDK版本: 在pom.xml文件中加入下一面一段语句来指定所用的版本,尽管在eclipse中配置了正确的“Build Path”:



maven-compiler-plugin

1.5
1.5
UTF-8




重新运行mvn clean eclipse:eclipse -Dmaven.test.skip=true,接着mvn package,问题解决。

5、如何在使用命令方式下载依赖的同时下载源码
1. 使用maven命令:mvn dependency:sources 下载依赖包的源代码。
2. 使用参数: -DdownloadSources=true 下载源代码jar。 -DdownloadJavadocs=true 下载javadoc包。
7、maven打包,忽略test的参数mvn -Dmaven.test.failure.ignore=true package mvn -Dmaven.test.skip=true clean package
8、web.xml which will be ignored[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored (webxml attribute is missing from war ask, or ignoreWebxml attribute is specified as 'true')在使用Maven 编译项目

的时候会出现 [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
解决方法:

org.apache.maven.plugins
maven-war-plugin
2.1.1


WEB-INF/web.xml


9、Maven3.04暂时不支持Servlet3的无web.xml形式[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war(default-war) on project prospringmvc01: Error assembling WAR: webxml attribute is required (orpre-existing WEB-INF/web.xml if executing in update mode) ->


10.如果报Cannot change version of project facet Dynamic Web Module to 3.0.
如果project facts 的dynamic web module 点击后没错误,可尝试将项目的problems的报错删除,即可解决

相关文档