Topic: Question on ClassLoader.getSystemResource
! In Java I in transit: port of the main project and to unwinding it is impossible to understand with behavior of function ClassLoader.getSystemResource. A problem. There is a test project, which (result the project), and supposed in a local repository. In this at start the resource by a call of type ClassLoader.getSystemResource ("abc.xml") is searched returned null and all falls. The necessary file in project resources is. The project through maven. The Test project also is launched through maven: mvn clean compile exec:java the Packet is called X.Y.Z and lies in source codes on an appropriate way main\java\X\Y\Z. abc.xml lies in a folder main\resources. That is clarified: 1. In the project there is a unit tests, as one of them I adapted a test project. All is launched it is a command mvn clean validate compile test. In frames a test unit all for some reason works. . Thus in a folder target\classes lies abc.xml and it is function ClassLoader.getSystemResource 2. I go to simple test project and I enclose in a folder target\classes a file abc.xml. I launch, function ClassLoader.getSystemResource does not find abc.xml. 3. If to move a file abc.xml from main\resources in main\resources\X\Y\Z, to replace ClassLoader.getSystemResource on Class.getResource, and to launch a test project Class.getResource finds a file inside . The purpose: it is necessary to play back behavior of a test project (namely ClassLoader.getSystemResource) in frames a test unit. Now quits that ClassLoader.getSystemResource at start from a test project does not find a file, and the test unit finds in frames. Though they lie on the same way target\classes. What to do?