java.lang.ExceptionInInitializerError mybatis初始化错误

初始化错误,原因项目只会编译java文件,编译后只有class文件xml等其他resource文件不会存在编译后的包里

java.lang.ExceptionInInitializerError mybatis初始化错误

解决方法:在项目或者模块的maven配置文件pom.xml中配置

<build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

 

相关推荐