Class PythonExecMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.iip_ecosphere.platform.tools.maven.python.PythonExecMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="exec-python") public class PythonExecMojo extends org.apache.maven.plugin.AbstractMojo
Maven Mojo for executing Python programs.
Author:
Alexander Weber, SSE, Holger Eichelberger, SSE
  • Field Details

    • project

      @Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject project
    • failOnError

      @Parameter(property="python-exec.failOnError", defaultValue="true") private boolean failOnError
    • skip

      @Parameter(property="python-exec.skip", required=false, defaultValue="false") private boolean skip
    • python

      @Parameter(property="python.binary", required=false, defaultValue="") private String python
    • pythonPath

      @Parameter(property="python.pythonpath", required=false, defaultValue="") private String pythonPath
    • pythonFile

      @Parameter(property="python-exec.file", required=true) private String pythonFile
    • directory

      @Parameter(property="python-exec.directory", required=false, defaultValue="src/test/python/") private String directory
    • args

      @Parameter(property="python-exec.args", required=false, defaultValue="") private List<String> args
    • pythonArgs

      @Parameter(property="python-exec.pythonArgs", required=false, defaultValue="") private List<String> pythonArgs
    • fileset

      @Parameter(required=false) private org.apache.maven.shared.model.fileset.FileSet fileset
      A specific fileSet rule to select files and directories.
  • Constructor Details

    • PythonExecMojo

      public PythonExecMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • composeEnvironment

      private String[] composeEnvironment()
      Composes the environment for the python exec call.
      Returns:
      the environment, my be null for none
    • runPython

      private String runPython(String[] cmd, String workingDirectory, String[] envp)
      Running the python file.
      Parameters:
      cmd - the command to run, shall run a python file
      workingDirectory - the directory of the python tests
      Returns:
      The output to add to the other outputs