I am building an archetype where I want to include a folder with some executable binaries. The problem is that when I create a new project from the archetype, the executable binaries are created without executable permissions.
How can I tell maven to keep execute permissions on those files ? Or maybe there is a mean to tell maven to add execute permissions automatically at generation time ?
This question is quite old, but I found myself in the same situation and I found a solution, so here it goes. Here it says that you can write a groovy script named archetype-post-generate.groovy in the src/main/resources/META-INF/ folder of your archetype in order to perform actions after the new project has been generated. The script should look like this one:
def file = new File( request.getOutputDirectory(), request.getArtifactId()+"RELATIVE_PATH" );
file.setExecutable(true, false);
where request.getOutputDirectory() is the directory where the new project will be created and request.getArtifactId() is the project artifact id.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With