Inside a maven project with some resources configured like this :
<webResources>
....
<resource>
<directory>${project.build.directory}/${temp.dir}</directory>
</resource>
</webResources>
the ${temp.dir} is generated conditionally by a plugin and do not exists always. When it is not there maven of course fail with an NPE, how could I fix this ?
I’m not sure if I understand what your problem (exactly) is, but it seems to me that Maven profiles could help you:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
In your case, probably you need profile activation on property existence, like this: