rpm-maven-plugin 2.1-alpha-3 does not execute scriptlets

744 views Asked by At

I have postInstall scriptlet in script.

But it is not getting executed

 <preinstallScriptlet>
    <script>echo "Installing now ${project.artifactId}-${project.version}-${timestamp}   /script>
                    </preinstallScriptlet>
                    <postinstallScriptlet>
                        <script>
                            echo "Updating Symlink"
                            ln -s -f
                            /usr/local/lib/myproject/${project.artifactId}-${project.version}-${timestamp}
                            /usr/local/lib/myproject/mycode
                        </script>
                    </postinstallScriptlet>
1

There are 1 answers

0
ahus1 On

I found that <script /> works well only with short, single commands, as XML formatting adds additional line breaks that don't work well with shell scripts. I suggest that you move your script code to a separate file and use <scriptFile /> instead. When you have the script in a separate file, it is also easier to test this script outside of the package.

Best regards, Alexander.