FileNotFoundException in src/main/resources

后端 未结 4 653
梦如初夏
梦如初夏 2020-12-16 11:48

i placed a file in my maven project under src/main/resources the files name is simply temp.txt.

When i try to open the file:

BufferedReader br = new          


        
4条回答
  •  独厮守ぢ
    2020-12-16 12:29

    Had this problem when setting up integration tests in Jenkins.
    The issue was caused by having the job inside a folder with spaces in the name. So instead of having a workspace folder named foo bar, Jenkins created foo%20bar and the tests all failed with FileNotFoundException.

    The solution is just to rename your folder so it doesn't have any spaces.

提交回复
热议问题