This is a follow up on How to Configure Eclipse to Work with `ehcache` and there is an example of absolute path in How to reference a local XML Schema file correctly?
Since the xsd
file is not longer being hosted, I downloaded a copy of it from the archive. I've put the file in my resource directory and would like to reference it in my xsi:schemaLocation
from a relative path of my project. We have both windows and mac developers, so an absolute path convention like file:///c:/project/foo
won't work.
Another alternative to relative path would be if there is a way to reference system properties for both windows and mac, then I could do 2 entries like file:///$HOME/workspace/foo
.
My project on my mac exists in ~/workspace/foo
and echo of $HOME gives my home path.
My spring-cache.xml
exists in ./src/main/webapp/WEB-INF/spring/
My ehcache-spring-1.2.xsd
exists in ./src/main/resources/
The following are some that I've tried without success:
file:///$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file:///./src/main/resources/ehcache-spring-1.2.xsd
file:///../../../../resources/ehcache-spring-1.2.xsd
file:///../../../../resources/ehcache-spring-1.2.xsd
../../../../resources/ehcache-spring-1.2.xsd
file://../../../../resources/ehcache-spring-1.2.xsd
file://$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file://./src/main/resources/ehcache-spring-1.2.xsd
file://../../../../resources/ehcache-spring-1.2.xsd
I also seem to have issues getting it to reference the file from absolute path too, so perhaps there is a different way to reference the file on mac? e.g. The following did not work:
file:///Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file:////Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file://Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd