Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

PropertyPlaceholderConfigurer using ${...}

$
0
0

I have a Spring application that is deployed in several environments each having a set of property files that have environment-specific things like database credentials, caching settings etc.

In my spring context there is a PropertyPlaceholderConfigurer:

 

    <!-- Configuration of environment-specific properties -->

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

        <property name="locations">

            <list>

                <value>${config.dir}/database.properties</value>

                <value>${config.dir}/mail.properties</value>

                <value>${config.dir}/remoting.properties</value>

            </list>

        </property>

    </bean>

 

 

config.dir is passed to the application via command-line parameter: -Dconfig.dir=file:/some/path

 

It works just fine, including integration tests that use Spring JUnit runner.

However, IintelliJ shows me that config.dir variable is not resolved, as well as all properties are not found (and they are shown as unused when the properties file is opened).

 

How can I set config.dir variable so that IntelliJ can pick up the properties file?


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>