MAVEN builds Spring Framework report Applicationcontext-*.xml file not found

Source: Internet
Author: User

Cause of the problem:

When I used MAVEN to build a Web project, I was not distributed, I put Pojo, DAO, service, web four layer directly in a parent project, and not one of the sub-engineering distinction, but directly packaged into a war package

So in the construction process there is no spring mapping file found, Web. xml file Error,

After I Baidu a bit found this configuration, by re-execution of the project, on the implementation of success

Add the following code to the project's Pom file
<!--If you do not add this node, the MyBatis mapper.xml file will be omitted.  -    <Build>        <Resources>            <!--If you do not add this node, the MyBatis mapper.xml file will be omitted.  -            <Resource>                <Directory>Src/main/java</Directory>                <includes>                    <include>**/*.properties</include>                    <include>**/*.xml</include>                </includes>                <filtering>False</filtering>            </Resource>            <Resource>                <Directory>Src/main/resources</Directory>                <includes>                    <include>**/*.properties</include>                    <include>**/*.xml</include>                </includes>                <filtering>False</filtering>            </Resource>        </Resources>        <!--Add a Tomcat plugin -        <Plugins>            <plugin>                <groupId>Org.apache.tomcat.maven</groupId>                <Artifactid>Tomcat7-maven-plugin</Artifactid>                <Configuration>                    <Port>8081</Port>                    <Path>/</Path>                </Configuration>            </plugin>        </Plugins>    </Build>

MAVEN builds Spring Framework report Applicationcontext-*.xml file not found

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.