问题
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.
来源:https://stackoverflow.com/questions/27030166/does-an-external-script-in-rpm-maven-plugin-have-access-to-maven-properties