How to keep executable permissions on files in a maven archetype
maven, maven-archetype
Solution
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.
Problem
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 ?