使用IDEA创建spring boot项目

使用IDEA创建spring boot项目

File–new–project
这里写图片描述
选择Spring Initializr
这里写图片描述
选择需要的组件或者框架
这里写图片描述
具体每个什么意思可以去百度或者查看API我这里只选择了Aspects,Web,Mybatis
这里写图片描述
最后设置好工作控件,基本大功告成,所有配置都可以在application.properties里配置
这里写图片描述
这里写图片描述
pom.xml添加代码

<resources>
    <resource>
        <directory>src/main/java</directory>
        <!-- 此配置不可缺,否则mybatis的Mapper.xml将会丢失 -->
        <includes>
            <include>**/*.xml</include>
        </includes>
        </resource>
        <!--指定资源的位置-->
        <resource>
            <directory>src/main/resources</directory>
    </resource>
</resources>

否则不扫描mapper.xml,mapper在注入时IDEA会报错不需要管它能正常运行

猜你喜欢

转载自blog.csdn.net/sunguoqiang1213/article/details/79640267