How can I specify the main resource directory in Maven as a File? I'm using ${project.resources[0]}
, but that is a org.apache.maven.model.Resource
, whereas I need a java.io.File
.
I need this for 开发者_如何学运维usage in the rpm-maven-plugin:
<mapping>
<directory>${app.home}/cfg</directory>
<sources>
<source>
<location>${project.resources[0]}</location>
</source>
</sources>
</mapping>
Indeed, resources/resource is a List<Resource>
. I may be wrong but I think that the best you can get from a resource is a String representing the directory where the resources are stored (which is a relative path to the POM).
${project.build.resources[0].directory}
精彩评论