catalina.home not being recognized by intellij

2020-05-03 12:16发布

问题:

I am using a property place holder to reference a file, it works when deployed, but intellij is not picking up the catalina home. I have tried setting windows environment varibale and path in intellij ide settings, makes no difference still shows an error (which borks my datasource in the ide) I could place the conf file in project directory instead, but then the project will not be portable to other tomcat installs without further jiggery pokery ....

Surely there is a way that intellij will recognize and reference correctly ${catalina.home} within my spring application context ?

Sys variable is set up ok :

回答1:

Apparently this is an open bug. However the workaround for me is to simply copy the properties file into project workspace (in my case the resources direcrtory), but keep the applicationContext.xml pointing at ${catalina.home}.

Intellij then picks up the property values and then the datasource can be set up easily.