码迷,mamicode.com
首页 > 其他好文 > 详细

找不到xml、找不到类

时间:2019-09-27 10:33:52      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:opened   maven打包   打包   lang   otf   art   cti   目的   需要   

解决 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> 

 

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

 

找不到xml、找不到类

标签:opened   maven打包   打包   lang   otf   art   cti   目的   需要   

原文地址:https://www.cnblogs.com/Alwaysbecoding/p/11595931.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!