does an external script in rpm-maven-plugin have a

2019-03-03 18:42发布

问题:

In an external postinstallScriptlet as follows, is there a way to access maven properties such as ${project.artifactId}? The pom.xml file has this snippet:

<postinstallScriptlet>
    <scriptFile>scripts/postinstall.sh</scriptFile>
    <fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>

回答1:

The properties are not directly accessible, but you can use the maven-resources-plugin copy-resources goal to apply filters while copying from your scripts directory into target. Your scriptFile configuration would then need to be changed to point to the copied resource under target.