Moco Maven Plugin

A maven plugin for managing a Moco stub server.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.garrettheel
ArtifactId

ArtifactId

moco-maven-plugin
Last Version

Last Version

0.9.3
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Moco Maven Plugin
A maven plugin for managing a Moco stub server.
Project URL

Project URL

https://github.com/GarrettHeel/moco-maven-plugin
Source Code Management

Source Code Management

http://github.com/GarrettHeel/moco-maven-plugin.git

Download moco-maven-plugin

How to add to project

<plugin>
    <groupId>com.garrettheel</groupId>
    <artifactId>moco-maven-plugin</artifactId>
    <version>0.9.3</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.2.1
com.github.dreamhead : moco-runner jar [0.9.2,0.9.9)
org.apache.httpcomponents : fluent-hc jar 4.3.6

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (2)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 1.3
junit : junit jar 4.8.1

Project Modules

There are no modules declared in this project.

Overview

This is a simple Maven plugin for managing a [Moco] (https://github.com/dreamhead/moco) server. It can be used to consistently run a Moco server on demand or to automatically launch the server during some part of the Maven lifecycle (such as integration-test).

Build Status

Usage

To get started, add the plugin to your pom.xml.

<plugin>
    <groupId>com.garrettheel</groupId>
    <artifactId>moco-maven-plugin</artifactId>
    <version>0.9.3</version>
    <configuration>
        <port>8081</port>
        <configFile>config.json</configFile>
    </configuration>
</plugin>

You may also need to add the Sonatype repository, depending on your environment.

<pluginRepositories>
    <pluginRepository>
        <id>sonatype</id>
        <url>https://oss.sonatype.org/content/repositories/public/</url>
    </pluginRepository>
</pluginRepositories>

Running manually

Starting the server manually is easy! Simply run the following command:

mvn com.garrettheel:moco-maven-plugin:run

This will run the the server indefinitely until the process is terminated.

Running during the maven lifecycle

You can also configure maven to start and stop the Moco server during the build lifecycle. For example, the following configuration would support using the server for integration testing:

<plugin>
    <groupId>com.garrettheel</groupId>
    <!-- ... -->
    <executions>
        <execution>
            <id>start-moco</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-moco</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Versions

Version
0.9.3
0.9.2
0.9
0.8.0