Question

how do I make maven to interpret only inner expressions in files ? Concrete situation is :

within archetype I'm creating, there is a resource web.xml element :

<context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>${artifactId}.root</param-value>  //${artifactId} gets resolved
</context-param> 

and in log4j.properties there is this line

log4j.appender.logfile.File=${${artifactId}.root}\WEB-INF\resources\${${artifactId}.root}.log  

where the inner expression should be interpreted by maven but the outer one not, because that is for log4j. Does maven recognize that it should resolve only the inner one ? or it doesn't see it.

Was it helpful?

Solution

I've never tried this with maven, but can you do something like this instead?

<properties>
    <log.root>${artificatId}.root</log.root>
</properties>

You'll want to have a look at escapeString from the maven-resources plugin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top