Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: maven-filtering
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      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>
      ...
      

        Activity

        Hide
        Stéphane Nicoll added a comment -

        this most probably is a maven filtering bug and not a maven war bug. Your description is not very clear: are you saying that you found out a solution to the issue but it's overcomplicated?

        Show
        Stéphane Nicoll added a comment - this most probably is a maven filtering bug and not a maven war bug. Your description is not very clear: are you saying that you found out a solution to the issue but it's overcomplicated?
        Hide
        Michael Cronin added a comment -

        Yes. There is a solution. It is overcomplicated and not intuitive.

        Show
        Michael Cronin added a comment - Yes. There is a solution. It is overcomplicated and not intuitive.
        Hide
        Graham Leggett added a comment -

        I am having the same problem. An attempt to configure this:

        export SERVER_ENV=\${SERVER_ENV:${httpd.server.env}}
        

        results in this:

        export SERVER_ENV=${SERVER_ENV:${httpd.server.env}}
        

        instead of this:

        export SERVER_ENV=${SERVER_ENV:sandbox}
        
        Show
        Graham Leggett added a comment - I am having the same problem. An attempt to configure this: export SERVER_ENV=\${SERVER_ENV:${httpd.server.env}} results in this: export SERVER_ENV=${SERVER_ENV:${httpd.server.env}} instead of this: export SERVER_ENV=${SERVER_ENV:sandbox}
        Hide
        Robert Scholte added a comment -

        IMO escaping is the preferred solution, which has been fixed with MSHARED-228. So I'm considering to close this as Won't Fix.

        Show
        Robert Scholte added a comment - IMO escaping is the preferred solution, which has been fixed with MSHARED-228 . So I'm considering to close this as Won't Fix .

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Michael Cronin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: