Not able to switch current directory from one spring project to another

68 Views Asked by At

I have an application with two different components. One is core (component A) and other has all file resources (component B). When I run application A runs and fetch files like xml, xslt, xsd from other component B. We have recently upgraded to latest version of spring 5 and open jdk 11. I am facing file not found exceptions after version upgrade while running junit tests of A. We are setting user.dir to switch current directory but still it is trying to check in A's folder structure.

Uses following

System.setProperty("user.dir", systemUserDir + "/../ComponentB/src/main/resources");

then we have this property mentioned properties file that we append to above

TEST.Test.XSLTFile=document/business/Test.xslt

So it should ideally search in ComponentB path but it tries searching file in Component A path.

1

There are 1 best solutions below

0
On

Looking at the https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8202127 I think you'll need another way of setting a directory where the resources should be found.

I might be able to help some more if you would share code which relies on the current directory set.