Property file and Environment Vars

Hello,

I am using IntelliJ with code that uses a property file.  The property contains something like this...

mavenVersion=${project.version}
svnRevision=${buildNumber}

logPath = ${log.path}
logFileName = ${log.filename}
logLevel = ${log.level}
logLayoutPattern = ${log.layout.pattern}
logDatePattern = ${log.date.pattern}
remoteLoggingEnabled = ${remote.logging.enabled}
logSocketRemoteHost = ${log.socket.remote.host}
logSocketPort = ${log.socket.port}
logSocketReconnectionDelay = ${log.socket.reconnection.delay}
logSocketLocationInfo = ${log.socket.location.info}
logSocketThreshold = ${log.socket.threshold}

The original project used Maven and the environment variables are set in the POM.XML.  However, I am not using Maven in IntelliJ

My IntelliJ project copies the properties file to the classes directory, but does not do the substitutions.  The compiled properties file is unchanged.

How do I get IntelliJ to do the substitutions and put the results on the classpath?

Thanks
Peter

3 comments
Comment actions Permalink

A bit more info...

I believe the Maven project is using the Maven Properites Plugin, and this plugin does the substitution

Here is the extract from the POM.XML file

        <!-- apply filtering to properties files to load maven settings into java -->
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
            </testResource>
        </testResources>

So, does IntelliJ have something like this, or can it use Maven somehow?

Thanks
Peter

0
Comment actions Permalink

Hello Peter,

Which IntelliJ version are you using? I think the correct property substitution
was first implemented in Maia.

I am using IntelliJ with code that uses a property file.  The property
contains something like this...

mavenVersion=${project.version}
svnRevision=$
logPath = ${log.path}
logFileName = ${log.filename}
logLevel = ${log.level}
logLayoutPattern = ${log.layout.pattern}
logDatePattern = ${log.date.pattern}
remoteLoggingEnabled = ${remote.logging.enabled}
logSocketRemoteHost = ${log.socket.remote.host}
logSocketPort = ${log.socket.port}
logSocketReconnectionDelay = ${log.socket.reconnection.delay}
logSocketLocationInfo = ${log.socket.location.info}
logSocketThreshold = ${log.socket.threshold}
The original project used Maven and the environment variables are set
in the POM.XML.  However, I am not using Maven in IntelliJ

My IntelliJ project copies the properties file to the classes
directory, but does not do the substitutions.  The compiled properties
file is unchanged.

How do I get IntelliJ to do the substitutions and put the results on
the classpath?

Thanks
Peter
---
Original message URL:
http://www.jetbrains.net/devnet/message/5244924#5244924

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Coolness Dimitry!

I updated to 8.1.3 and the problem went away.

Thanks
P

0

Please sign in to leave a comment.