The appassembler maven plugin does not set execute permission on the generated script

The AppAssembler Maven plugin does an excellent distro job for me. One of the latest problems is that the generated shell script does not have execute permissions, so I need to install them manually.

I'm on Linux RedHat

Does anyone know how to install them automatically?

+6
source share
3 answers

The only way to do this is to process the file using another maven plugin, such as Antrun or Assembly after running AppAssembler .

This issue (see link below) was raised on the tracker for the AppAssembler project issue, and it was rejected as Won't Fix .

Problem: MAPPASM-54

+7
source

I think it can be installed in your assembly.xml , in the fileSet tag:

 <fileSets> <fileSet> <directory>src/resources/bin</directory> <lineEnding>keep</lineEnding> <useDefaultExcludes>true</useDefaultExcludes> <outputDirectory>bin</outputDirectory> <includes> <include>*.bat</include> <include>*.sh</include> </includes> <fileMode>744</fileMode> </fileSet> ... 
+2
source

Since Maven 3.0.3 all plugins are executed in the order in which they are in your pom.xml. Thus, setting a valid flag in an independent platform is as simple as using the maven-enforcer plugin right after your appassembler plugin.

  <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <id>enforce-beanshell</id> <phase>package</phase> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <evaluateBeanshell> <condition> import java.io.File; print("set executable for file ${basedir}/dist/bin/mql"); new File("${basedir}/dist/bin/mql").setExecutable(true,false); true; </condition> </evaluateBeanshell> </rules> <fail>false</fail> </configuration> </execution> </executions> </plugin> 
0
source

Source: https://habr.com/ru/post/906804/


All Articles