使用 maven 构建后未找到来自 src/main/资源的资源
您好,我正在我的java应用程序中使用来自src / main /resources的配置文件。我在课堂上读到它,就像这样:
new BufferedReader(new FileReader(new File("src/main/resources/config.txt")));
所以现在我正在用 maven 使用 .这是我的pom中的位.xml:mvn assembly:assembly
<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <finalName>TestSuite</finalName>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>com.some.package.Test</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
因此,当我运行我的应用程序时,我收到此错误:
src\main\resources\config.txt (The system cannot find the path specified)
但是当我右键单击我组装好的罐子时,我可以看到它里面,有人知道我做错了什么吗?
 
					 
				 
				    		 
				    		 
				    		 
				    		