Maven: невозможно выполнить сценарий оболочки
Вот как я пытаюсь выполнить сценарий оболочки
<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]
Что я делаю неправильно?
1 ответ
Решение
Из ваших ошибок я вижу
ошибка =13, в доступе отказано
Попробуйте дать разрешение buildPython.sh с помощью задачи chmod ant plugin, чтобы посмотреть, решит ли она проблему. Увидеть ниже,
<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.
Спасибо