1
Error
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":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":dependencies, "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.
POM.XML
<code>
<project xmlns="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.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.wdn.curso</groupId>
<artifactId>intro-spring-mvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<build>
<finalName>intro-spring-mvc</finalName>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9090</port>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
</code>
even after adding the tag
<dependencies>
the error remains the same.– William
I don’t know which IDE you’re using, but in Eclipse, you need to update the Maven Project (
ALT + F5
).– Homer Simpson
I was using the eclipse, and now that I’ve updated the Maven project it worked! Thanks for the help.
– William