Kể từ Maven 3.0.3 tất cả các plugin được thực hiện theo thứ tự họ đang có trong pom.xml của bạn. Vì vậy, thiết lập cờ thực thi theo cách nền tảng độc lập dễ dàng như việc sử dụng trình bổ sung maven-executecer ngay sau plugin appassembler của bạn.
<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>
2.0.0 đặt bit + x trên tập lệnh được tạo. –