Spi*_*idE 16 maven python-2.7 exec-maven-plugin
我在Win 7上使用maven来构建应用程序.我使用exec插件来调用python脚本.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>create-dir</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>src/main/upgrade/create.py</executable>
<arguments>
<argument>ChangeSet.txt</argument>
</arguments>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我在构建项目时遇到以下错误.
Embedded error: Cannot run program "pathToScript/create.py" CreateProcess error=193, %1 is not a valid Win32 application
Run Code Online (Sandbox Code Playgroud)
我确实安装了python并添加到%PATH变量中.
如何修复它以使其独立于OS平台工作?
.:-编辑-:.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<executable>python</executable>
<workingDirectory>src/main/upgrade/</workingDirectory>
<arguments>
<argument>createChangeSet.py</argument>
</arguments>
</configuration>
<id>python-build</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
Rya*_*art 16
在Windows中,脚本不可执行.可执行文件是python解释器,脚本是它的参数,因此将<executable>path to your python interpreter</executable>脚本添加并添加为<argument>.我希望同样适用于任何平台,但我不是Python专家.
| 归档时间: |
|
| 查看次数: |
15435 次 |
| 最近记录: |