Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven exec plugin - Executing a python script
    text
    copied!<p>I am using maven on Win 7 to build an application. I use the exec plugin to invoke a python script. </p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.2.1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;create-dir&lt;/id&gt; &lt;phase&gt;process-classes&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;exec&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;configuration&gt; &lt;executable&gt;src/main/upgrade/create.py&lt;/executable&gt; &lt;arguments&gt; &lt;argument&gt;ChangeSet.txt&lt;/argument&gt; &lt;/arguments&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>I get the below error when I build the project.</p> <pre><code>Embedded error: Cannot run program "pathToScript/create.py" CreateProcess error=193, %1 is not a valid Win32 application </code></pre> <p>I do have python installed and added to the %PATH variable.</p> <p>How do I fix it such that it will work independent of OS platform ?</p> <p>.:-EDIT-:.</p> <h1>WORKING CODE SNIPPET</h1> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;configuration&gt; &lt;executable&gt;python&lt;/executable&gt; &lt;workingDirectory&gt;src/main/upgrade/&lt;/workingDirectory&gt; &lt;arguments&gt; &lt;argument&gt;createChangeSet.py&lt;/argument&gt; &lt;/arguments&gt; &lt;/configuration&gt; &lt;id&gt;python-build&lt;/id&gt; &lt;phase&gt;prepare-package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;exec&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload