maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte (JIRA)" <j...@codehaus.org>
Subject [jira] (MSHARED-143) Nested variables are not filtered
Date Sun, 09 Feb 2014 18:44:57 GMT

     [ https://jira.codehaus.org/browse/MSHARED-143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Scholte updated MSHARED-143:
-----------------------------------

    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
{code: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>
...
{code}


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






> Nested variables are not filtered
> ---------------------------------
>
>                 Key: MSHARED-143
>                 URL: https://jira.codehaus.org/browse/MSHARED-143
>             Project: Maven Shared Components
>          Issue Type: Improvement
>          Components: maven-filtering
>         Environment: Apache Maven 2.2.1 (r801777; 2009-08-06 19:16:01+0000)
> Java version: 1.5.0_12
> Java home: /usr/java/jdk1.5.0_12/jre
> Default locale: en_US, platform encoding: ANSI_X3.4-1968
> OS name: "linux" version: "2.6.18-92.1.22.el5xen" arch: "i386" Family: "unix"
>            Reporter: Michael Cronin
>
> 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
> {code: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>
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message