GithubHelp home page GithubHelp logo

chonton / process-exec-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bazaarvoice/maven-process-plugin

10.0 4.0 1.0 106 KB

Maven: start multiple processes in pre-integration-test phase in order.

License: Apache License 2.0

Java 100.00%
execute maven-plugin

process-exec-maven-plugin's Introduction

process-exec-maven-plugin

Improve end-to-end integration testing with maven. Process Executor Plugin allows you to to start multiple processes in pre-integration-test phase in order, and then stops all the processes in post-integration-test phase, in reverse order.

Goals

  • start - Pre-Integration-test phase. Starts a given process in the pre-integration-test phase. Requires one execution per process.
  • stop-all - Post-Integration-test phase. Stops all processes that are started in the pre-integration-test phase, in reverse order. Requires only one execution for all processes.

Arguments

  • arguments: Command line arguments as you would provide when starting a process in your terminal. So, for example to run something like this
   java -jar drop-wizard-app.jar server config.yaml

set arguments as:

  <arguments>
    <argument>${java.home}/bin/java</argument>
    <argument>-jar</argument>
    <argument>drop-wizard-app.jar</argument>
    <argument>server</argument>
    <argument>config.yaml</argument>
  </arguments>
  • environment: Environment variables for the process
  <environment>
    <TERM>vt100</TERM>
  </environment>
  • name: Give a name to the process to start.
  • workingDir: Give a working directory for your process to start in. Could be same as name. If not provided, the build directory is used.
  • waitForInterrupt: Optional. Setting this value to true will pause your build after starting every process to give you a chance to manually play with your system. Default is false.
  • healthCheckUrl: Recommended, but optional. You should provide a healthcheck url, so the plugin waits until the healthchecks are all green for your process. If not provided, the plugin waits for waitAfterLaunch seconds before moving on.
  • healthCheckValidateSsl: Optional. If healthCheckUrl is specified, and is an HTTPS URL, Java's default SSL TrustManager will be used by default. If you are using a self-signed certificate, this parameter can be set to false to use a TrustManager that doesn't validate the certification path.
  • waitAfterLaunch: Optional. This specifies the maximum time in seconds to wait after launching the process. If healthCheckUrl is specified, then it will move on as soon as the health checks pass. Default is 30 seconds.
  • processLogFile: Optional. Specifying a log file will redirect the process output to the specified file. Recommended as this will avoid cluttering your build's log with the log of external proccesses.

Killing processes on exit

Killing the maven process (using Ctrl+C or kill <pid> command) will stop all the processes started by the plugin.

HealthCheckUrl

The health check url can be any scheme natively supported by JRE, or 'tcp'. Additional url schemes can be supported as described in url-extension

POM example:

<build>
  <plugins>
    <plugin>
      <groupId>org.honton.chas</groupId>
      <artifactId>process-exec-maven-plugin</artifactId>
      <version>0.9.2</version>
      <executions>
        <!--Start process 1, eg., a dropwizard app dependency-->
        <execution>
          <id>switchboard-process</id>
          <phase>pre-integration-test</phase>
          <goals>
            <goal>start</goal>
          </goals>
          <configuration>
            <name>Switchboard2</name>
            <workingDir>switchboard2</workingDir>
            <waitForInterrupt>false</waitForInterrupt>
            <healthCheckUrl>http://localhost:8381/healthcheck</healthCheckUrl>
            <arguments>
              <argument>${java.home}/bin/java</argument>
              <argument>-jar</argument>
              <argument>${basedir}/../../app/target/switchboard-${project.version}.jar</argument>
              <argument>server</argument>
              <argument>${basedir}/bin/switchboard.yaml</argument>
            </arguments>
          </configuration>
        </execution>
        <!--Start process 2, eg., another dropwizard app dependency-->
        <execution>
          <id>emodb-shovel-process</id>
          <phase>pre-integration-test</phase>
          <goals>
            <goal>start</goal>
          </goals>
          <configuration>
            <name>emodb-shovel</name>
            <workingDir>shovel</workingDir>
            <waitForInterrupt>false</waitForInterrupt>
            <healthCheckUrl>http://localhost:8181/healthcheck</healthCheckUrl>
            <arguments>
              <argument>${java.home}/bin/java</argument>
              <argument>-jar</argument>
              <argument>${basedir}/../../app/target/emodb-shovel-app-${project.version}.jar</argument>
              <argument>server</argument>
              <argument>${basedir}/bin/config-local-dc.yaml</argument>
            </arguments>
          </configuration>
        </execution>
        <!--Stop all processes in reverse order-->
        <execution>
          <id>stop-all</id>
          <phase>post-integration-test</phase>
          <goals>
            <goal>stop-all</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

process-exec-maven-plugin's People

Contributors

bbeck avatar bpiper avatar chonton avatar fahdsiddiqui avatar fibrefox avatar r48patel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

larskrogjensen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.