Skip to content
Advertisement

How can I resolve Windows vs Linux properties file paths?

I have a java project on a Windows box which builds successfully and all tests pass locally. This project is then checked in and built with Jenkins on a Linux box.

The problem I am having is related to path issues in my properties file which is used for running tests. I point to a resources dir for part of a file path like this: “./src/test/resources”.

I am trying to access two files which reside in the same directory. File1 is accessed successfully. Then File2 access is attempted, but it returns a file not found exception.

I’ve tried using an absolute path like this: “/code/myproject/main/src/test/resources/…” This again works on my local box, but not on Jenkins because Jenkins only knows about” “/myproject/main/src/test/resources/…”

How can this be resolved?

Advertisement

Answer

Today I learned Linux is case sensitive. The file name extension is upper case, but I was pointing to a lower case one.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement