Maven:无法执行shell脚本

Maven:无法执行shell脚本,shell,maven,maven-exec-plugin,Shell,Maven,Maven Exec Plugin,下面是我如何尝试执行shell脚本 <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <executions> <execution>

下面是我如何尝试执行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>

我做错了什么?

从你的错误中,我可以看出

错误=13,权限被拒绝

尝试使用ant插件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>

org.apache.maven.plugins
maven antrun插件
1.8
建筑
编写
跑
在${basedir}中运行chmod
永久地,使用git的.gittributes或subversion的svn:executable属性授予权限


谢谢

我想使用maven授予权限。我该怎么做?我以为
标签会解决这个问题,我已经修改了我的答案。
<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>