这是我如何尝试执行shell脚本
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution><!-- Build Python Executable -->
<id>Build Python</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/buildPython.sh</executable>
</configuration>
</execution>
</executions>
<configuration>
<executable>chmod</executable>
<arguments>
<argument>+x</argument>
<argument>${basedir}/scripts/buildPython.sh</argument>
</arguments>
</configuration>
</plugin>
但是我得到了
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (Build Python) on project packaging: Command execution failed. Cannot run program "/ajbfiausbf/scripts/buildPython.sh" (in directory "/ajbfiausbf`"): error=13, Permission denied -> [Help 1]
我做错了什么?
答案 0 :(得分:1)
根据您的错误,我可以看到
错误= 13,权限被拒绝
尝试使用ant plugin chmod任务授予buildPython.sh权限,以查看它是否解决了问题。见下文,
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>build</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>run chmod in ${basedir}</echo>
<chmod file="${basedir}/scripts/buildPython.sh" perm="ugo+rx"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
永久性地,使用.gitattributes为git或svn:可执行属性为subversion提供权限。
由于