找不到xml、找不到类

解决 java.io.FileNotFoundException: class path resource [xxx.xml] cannot be opened because it does not exist

解决 java.io.FileNotFoundException: class path resource [xxx.properties] cannot be opened because it does not exist

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

解决java.lang.ClassNotFoundException

说一下我的情况:A项目依赖B项目的1.1.1版本的jar包。可是我用maven打包B项目的时候是打的2.2.2版本的jar包。

所以A项目找不到所依赖的B项目1.1.1版本,自然也找不到需要的class类。所以修改B项目pom.xml中的打包版本为1.1.1即可

    <groupId>com.xxx</groupId> 
    <artifactId>B-war</artifactId>
    <packaging>war</packaging>
    <version>1.1.1</version> 

你也许不是这种情况,需要找找别的办法。

猜你喜欢

转载自www.cnblogs.com/Alwaysbecoding/p/11595931.html