Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-143

Nested variables are not filtered

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • maven-filtering
    • None

    Description

      I am trying to filter my log4j.properties file in WEB-INF. One line is troublesome. The resulting line should be

      log4j.appender.mine.File=${myProject.root}/WEB-INF/logs/mine.log

      where myProject is the value of the property project.artifactId.

      I try

      log4j.appender.mine.File=${${project.artifactId}.root}/WEB-INF/logs/mine.log

      but no substitution is done.

      After much trial and error, I use

      log4j.appender.mine.File=!#!$${log4j.root}/WEB-INF/logs/mine.log

      and the following in my pom.xml

      <properties>
        <log4j.root>{$project.artifactId}.root}</log4j.root>
      </properties>
      ...
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1-beta-1</version>
            <configuration>
              <escapeString>!#!</escapeString>
      ...
            </configuration>
          </plugin>
        </plugins>
      </build>
      ...
      

      Attachments

        Activity

          People

            rfscholte Robert Scholte
            mtcronin99 Michael Cronin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: