This is typically done by placing these kind of scripts as Maven resources. Using Maven properties ('jarName = "myApp-${project.version}.jar"') instead of hardcoded values, and activating filtering on these resources will make this straightforward.
If these scripts should be packaged in a different way than just inside the JAR produced, the assembly plugin will be able to do the job.