导入写好的maven项目,pom.xml报错:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'dependency'. One of '{"http://
maven.apache.org/POM/4.0.0":parent, "http://maven.apache.org/POM/4.0.0":description, "http://
maven.apache.org/POM/4.0.0":prerequisites, "http://maven.apache.org/POM/
4.0.0":issueManagement, "http://maven.apache.org/POM/4.0.0":ciManagement, "http://
maven.apache.org/POM/4.0.0":inceptionYear, "http://maven.apache.org/POM/4.0.0":mailingLists,
"http://maven.apache.org/POM/4.0.0":developers, "http://maven.apache.org/POM/4.0.0":contributors,
"http://maven.apache.org/POM/4.0.0":licenses, "http://maven.apache.org/POM/4.0.0":scm, "http://
maven.apache.org/POM/4.0.0":organization, "http://maven.apache.org/POM/4.0.0":build, "http://
maven.apache.org/POM/4.0.0":profiles, "http://maven.apache.org/POM/4.0.0":modules, "http://
maven.apache.org/POM/4.0.0":reports, "http://maven.apache.org/POM/4.0.0":reporting, "http://
maven.apache.org/POM/4.0.0":dependencyManagement, "http://maven.apache.org/POM/
4.0.0":distributionManagement, "http://maven.apache.org/POM/4.0.0":properties}' is expected.
问题代码:<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
请把完整的pom.xml贴出来,这样看不出来,感觉是开头的XSD错误:
<projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd">版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。