IDEA | JAVA | maven | Invalid content was found starting with element ‘{“……“:dependency}‘.

文章目录

错误信息

是小白我直接把maven添加到pom.xml中导致出错

Invalid content was found starting with element 
'{"http://maven.apache.org/POM/4.0.0":dependency}'. 
One of '{"http://maven.apache.org/POM/4.0.0":parent, 
"http://maven.apache.org/POM/4.0.0":packaging, 
"http://maven.apache.org/POM/4.0.0":name, 
"http://maven.apache.org/POM/4.0.0":description, 
"http://maven.apache.org/POM/4.0.0":url, 
"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":repositories, 
"http://maven.apache.org/POM/4.0.0":pluginRepositories, 
"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.

解决方案

  • 添加<dependencies></dependencies>
    <dependencies>
        <dependency>
		……
        </dependency>
    </dependencies>

猜你喜欢

转载自blog.csdn.net/stone_fall/article/details/108140716