GithubHelp home page GithubHelp logo

tsundberg / maven-wait-plugin Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 88 KB

A maven plugin that waits for an http resource to be available

License: MIT License

Java 100.00%
maven-plugin java-8 spark-java http

maven-wait-plugin's Introduction

Maven wait plugin

A maven plugin that waits for an http resource to be available.

It will fail the build if the wanted resource isn't available within a time limit.

Usage

Specify the url and call the plugin during your build.

There is one goal. Maven requires you to call it explicit.

Configuration

Url

The url where an http resource should be available.

<url>http://localhost:4040//geo/rest/v1/gata</url>

Timeout

The time in milliseconds to wait for a resource.

<timeout>1000</timeout>

Headers

The headers you want to set. Multiple headers are supported. Specify each header in a headers section.

This example specifies one header.

<headers>
    <applicationId>Acceptance test</applicationId>
</headers>

Example

Here is a complete example where we are waiting for a resource to appear at http://localhost:4040//geo/rest/v1/gata, allow 1000 milliseconds before a timeout and set the header applicationId to Acceptance test

<plugin>
    <groupId>se.thinkcode.wait</groupId>
    <artifactId>http</artifactId>
    <version>${project.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>wait</goal>
            </goals>
            <configuration>
                <url>http://localhost:4040/geo/rest/v1/gata</url>
                <timeout>1000</timeout>
                <headers>
                    <applicationId>Acceptance test</applicationId>
                </headers>
            </configuration>
        </execution>
    </executions>
</plugin>

Skip waiting

Skip waiting by setting http.wait.skip to true

<http.wait.skip>true</http.wait.skip>

or by passing

-Dhttp.wait.skip

when running Maven.

Waitable Status Codes

By default, this plugin waits as long as a 404 response status code is returned. You can configure additional status codes on which the plugin should wait via the waitableStatuses configurable element:

<waitableStatuses>
    <waitableStatus>404</waitableStatus>
    <waitableStatus>503</waitableStatus>
</waitableStatuses>

This will not append to the default of waiting on 404 responses, so you will need to deliberately specify that here if you wish to continue waiting on such a response status code.

Release

Instructions are available in release.md and at Sonatype

maven-wait-plugin's People

Contributors

benjefferies avatar dependabot[bot] avatar miv-henrikcaesar avatar tsundberg avatar

Watchers

 avatar  avatar

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.