Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

CJSCommonPlatform/server-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Maven Plugin

Deprecated

Pull requests against this project have been disabled. Please contact one of the project owners for emergency bug fixes on this version

Build Status Coverage Status

A maven plugin that can be used to start and stop a server (like embedded Artemis) within a maven test cycle.

##Example usage in pom.xml

    <plugin>
	<groupId>uk.gov.justice.plugin</groupId>
	<artifactId>server-maven-plugin</artifactId>
	<configuration>
		<!-- The port used to stop the spawned process -->
		<port>9092</port>
		<!-- The name of the class used to start the embedded server -->
        <serverClass>uk.gov.justice.artemis.EmbeddedArtemisServer</serverClass>
	</configuration>
	<executions>
		<execution>
			<id>Spawn a new Artemis server</id>
			<phase>process-test-classes</phase>
			<goals>
				<goal>start</goal>
			</goals>
		</execution>
		<execution>
			<id>Stop a spawned Artemis server</id>
			<phase>verify</phase>
			<goals>
				<goal>stop</goal>
			 </goals>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<!-- Add all the dependencies required for the spawned Server to run -->			
		</dependency>
	</dependencies>
    </plugin>

The plugin starts a server using the supplied serverClass during the process-test-classes phase and shuts it down during the verify phase.

##Running the plugin

mvn verify

##Tip

Checkout the example-it project in the microservice_framework for a concrete example