Maven Central   mockserver

Maven Central contains the following released MockServer artifacts:

     
  • mockserver-netty - a web server for mocking and proxying using Netty

    Add to a maven build pom.xml as follows:

    <dependencies>
        ...
        <dependency>
    	    <groupId>org.mock-server</groupId>
    	    <artifactId>mockserver-netty-no-dependencies</artifactId>
    	    <version>RELEASE</version>
        </dependency>
        ...
    <dependencies>

    Add to a gradle build build.gradle as follows:

    dependencies {
        ...
        testImplementation("org.mock-server:mockserver-netty-no-dependencies:5.14.0")
        ...
    }

    The following versions are available for mockserver-netty in Maven Central. These dependencies work for Maven, Gradle, Scala SBT, Apache Ivy, etc

    • org.mock-server:mockserver-netty-no-dependencies:5.14.0 - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. This has no transitive dependencies and so is the recommended best option.
    • org.mock-server:mockserver-netty:5.14.0 - only compiled code with transitive dependencies pulled in by Maven, Gradle, etc. As per normal Maven or Ivy dependencies this includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded.
    • org.mock-server:mockserver-netty:5.14.0:shaded - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-netty-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
    • org.mock-server:mockserver-netty:5.14.0:jar-with-dependencies - compiled code and transitive dependencies bundled into a single jar. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-netty-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
  • mockserver-war - a deployable WAR for mocking that can be deployed to any JEE web server, this artifact can be downloaded.
  • mockserver-proxy-war - a deployable WAR for proxying that can be deployed to any JEE web server, this artifact can be downloaded.
  • mockserver-maven-plugin - a set of maven plugins to start, stop and fork MockServer using maven

    Add to a maven build pom.xml as follows:

    <plugin>
        <groupId>org.mock-server</groupId>
        <artifactId>mockserver-maven-plugin</artifactId>
        <version>RELEASE</version>
        <configuration>
            <serverPort>1080</serverPort>
            <pipeLogToConsole>true</pipeLogToConsole>
        </configuration>
    </plugin>
     
  • mockserver-client-java - a Java client to communicate with both the server and the proxy

    Add to a maven build pom.xml as follows:

    <dependency>
    	<groupId>org.mock-server</groupId>
    	<artifactId>mockserver-client-java-no-dependencies</artifactId>
    	<version>RELEASE</version>
    </dependency>

    Add to a gradle build build.gradle as follows:

    dependencies {
        ...
        testImplementation("org.mock-server:mockserver-client-java-no-dependencies:5.14.0")
        ...
    }

    The following versions are available for the Java client in Maven Central. These dependencies work for Maven, Gradle, Scala SBT, Apache Ivy, etc

    • org.mock-server:mockserver-client-java-no-dependencies:5.14.0 - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. This has no transitive dependencies and so is the recommended best option.
    • org.mock-server:mockserver-client-java:5.14.0 - only compiled code with transitive dependencies pulled in by Maven, Gradle, etc. As per normal Maven or Ivy dependencies this includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded.
    • org.mock-server:mockserver-client-java:5.14.0:shaded - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-client-java-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
    • org.mock-server:mockserver-client-java:5.14.0:jar-with-dependencies - compiled code and transitive dependencies bundled into a single jar. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-client-java-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
  • mockserver-junit-rule - a Junit 4 @Rule that starts MockServer (for both mocking and proxying) on a free port before the any test runs and stops MockServer after all tests have completed.

    The following versions are available for mockserver-junit-rule in Maven Central. These dependencies work for Maven, Gradle, Scala SBT, Apache Ivy, etc

    • org.mock-server:mockserver-junit-rule-no-dependencies:5.14.0 - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. This has no transitive dependencies and so is the recommended best option.
    • org.mock-server:mockserver-junit-rule:5.14.0 - only compiled code with transitive dependencies pulled in by Maven, Gradle, etc. As per normal Maven or Ivy dependencies this includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded.
    • org.mock-server:mockserver-junit-rule:5.14.0:shaded - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-junit-rule-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
    • org.mock-server:mockserver-junit-rule:5.14.0:jar-with-dependencies - compiled code and transitive dependencies bundled into a single jar. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-junit-rule-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
  • mockserver-junit-jupiter - a Junit 5 Test Extension that starts MockServer (for both mocking and proxying) on a free port before the any test runs and stops MockServer after all tests have completed.

    The following versions are available for mockserver-junit-jupiter in Maven Central. These dependencies work for Maven, Gradle, Scala SBT, Apache Ivy, etc

    • org.mock-server:mockserver-junit-jupiter-no-dependencies:5.14.0 - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. This has no transitive dependencies and so is the recommended best option.
    • org.mock-server:mockserver-junit-jupiter:5.14.0 - only compiled code with transitive dependencies pulled in by Maven, Gradle, etc. As per normal Maven or Ivy dependencies this includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded.
    • org.mock-server:mockserver-junit-jupiter:5.14.0:shaded - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-junit-jupiter-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
    • org.mock-server:mockserver-junit-jupiter:5.14.0:jar-with-dependencies - compiled code and transitive dependencies bundled into a single jar. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-junit-jupiter-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
  • mockserver-spring-test-listener - a Spring Test Execution Listener that starts MockServer (for both mocking and proxying) for writing mockserver tests in spring projects

    The following versions are available for mockserver-spring-test-listener in Maven Central. These dependencies work for Maven, Gradle, Scala SBT, Apache Ivy, etc

    • org.mock-server:mockserver-spring-test-listener-no-dependencies:5.14.0 - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. This has no transitive dependencies and so is the recommended best option.
    • org.mock-server:mockserver-spring-test-listener:5.14.0 - only compiled code with transitive dependencies pulled in by Maven, Gradle, etc. As per normal Maven or Ivy dependencies this includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded.
    • org.mock-server:mockserver-spring-test-listener:5.14.0:shaded - compiled code and transitive dependencies bundled into a single jar, with packages for most transitive dependencies being updated to avoid clashes with dependencies from projects importing MockServer. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-spring-test-listener-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
    • org.mock-server:mockserver-spring-test-listener:5.14.0:jar-with-dependencies - compiled code and transitive dependencies bundled into a single jar. Because classifiers all use the same pom.xml this library still includes transitive dependencies (in its pom.xml) which would be pulled in by Maven, Gradle, Ivy, SBT, etc unless explicitly excluded. Use the org.mock-server:mockserver-spring-test-listener-no-dependencies:5.14.0 dependencies to avoid the transitive dependencies.
 

Sonatype SNAPSHOT

The latest SNAPSHOT version can be found at Sonatype

Maven

To use the SNAPSHOT version in a maven project you need to configure your maven settings.xml or your pom.xml to include the Sonatype SNAPSHOT repository as follows:

<profile>
    <id>sonatype</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>sonatype-nexus-snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>sonatype-nexus-snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</profile>

Note: typically it is best practice to configure the ~/.m2/settings.xml file instead of the settings.xml file located inside the conf directory in the maven installation directory (i.e. $M2_HOME). This is because the ~/.m2/settings.xml file will be consistent between maven version upgrades and any changes to this file will only affect a single user.

Once the Sonatype SNAPSHOT repository has been added, as above, the latest SNAPSHOT build can referenced.

For example add a dependency on the latest SNAPSHOT build for mockserver-netty, as follows:

<dependency>
	<groupId>org.mock-server</groupId>
	<artifactId>mockserver-netty</artifactId>
	<version>SNAPSHOT</version>
	<classifier>shaded</classifier>
</dependency>

Gradle

To use the SNAPSHOT version in a gradle project you need to add the correct repository into the project as follows:

repositories {
    ...
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    ...
}

Once the Sonatype SNAPSHOT repository has been added, the latest SNAPSHOT build can referenced, as follows:

dependencies {
    ...
    testImplementation("org.mock-server:mockserver-netty:5.14.1-SNAPSHOT")
    ...
}