문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top