Spring MVC tutorial project not building on IntelliJ

I am trying to create and run a Spring MVC beginner lesson project using IntelliJ. I imported an existing project from GitHub. But when I try to build the project, I keep getting:

Error:(3, 38) java: package org.springframework.stereotype does not exist
Error:(4, 47) java: package org.springframework.web.bind.annotation does not exist

      

These external dependency banks are under my local Maven repos (C: \ Users \ sudi.m2) and I can see in IntelliJ under Maven-> Repositories that the repo location is indeed there. I also tried "Invalidate Cache and restart" but it doesn't help. My M2_HOME is set correctly to C: \ apache-maven-3.2.2. If I try to run mvn install from the command line, I get:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.845 s
[INFO] Finished at: 2014-09-25T19:03:21+05:30
[INFO] Final Memory: 9M/93M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war    (default-war) on project basic-web-app: Error assembling WAR: webxml attribute is required    (or preexisting WEB-INF/web.xml if executing in update mode) -> [Help 1]

      

Any suggestions are greatly appreciated.

+3


source to share


2 answers


If the project does not have a web.xml file (IE: java config fully supported). The war build plugin will fail unless you set the "failOnMissingWebXml" attribute to false.



+1


source


Delete the local .m2 repository and reload any required jars. There may have been problems loading one of the dependencies.



0


source







All Articles