This is an old question, and there are many answers, most of which will be more or less helpful; however, there is one, very important and still relevant point, which none of the answers touch (providing, instead, different hacks to make build possible), and which, I think, in no way has a less importance.. on the contrary.
According to your log message, you are using Maven, which is a Project Management tool, firmly following the conventions, over configuration principle.
When Maven builds the project:
- it expects your project to have a particular directory structure, so that it knows where to expect what. This is called a
Maven's Standard Directory Layout
;
- during the build, it creates also proper directory structure and places files into corresponding locations/directories, and this, in compliance with the
Sun Microsystems Directory Structure Standard
for Java EE [web] applications.
You may incorporate many things, including maven plugins, changing/reconfiguring project root directory, etc., but better and easier is to follow the default conventions over configuration, according to which, (now is the answer to your problem) there is one simple step that can make your project work: Just place your web.xml
under src\main\webapp\WEB-INF\
and try to build the project with mvn package
.