Union VMS - Parent POM

Info

We have introduced a common parent for all App modules that enforces the build environment.
Added profiles for running docker with the arquillian test.
Defined a set modules with common dependencies for uvms-pom-gis-deps (jpa,gis), uvms-pom-logging-deps (slf4j,logback etc), uvms-pom-monitoring-deps, uvms-pom-arquillian-deps, uvms-pom-test-deps.

Latest released version is 1.11 and github project is at https://github.com/UnionVMS/uvms-pom/tree/dev.

Both Movememt-App and Mobileterminal-App have been updated to use the this parent pom, look at https://github.com/UnionVMS/UVMS-MobileTerminalModule-APP/tree/dev and https://github.com/UnionVMS/UVMS-MovementModule-APP/tree/dev how it’s been applied.

To be able to use the parent pom, a few steps need to be performed to your root project se below.

Add the parent pom definition 

Example at https://github.com/UnionVMS/UVMS-MovementModule-APP/blob/master/pom.xml

<parent>
	<groupId>fish.focus.uvms.maven</groupId>
	<artifactId>uvms-pom</artifactId>
	<version>INSERTCURRENTVERSION</version>
</parent>

Add the the common deps modules to dependency management

Example at https://github.com/UnionVMS/UVMS-MovementModule-APP/blob/dev/pom.xml.

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>fish.focus.uvms.maven</groupId>
			<artifactId>uvms-pom-gis-deps</artifactId>
			<version>INSERTCURRENTVERSION</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.maven</groupId>
			<artifactId>uvms-pom-logging-deps</artifactId>
			<version>INSERTCURRENTVERSION</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.maven</groupId>
			<artifactId>uvms-pom-monitoring-deps</artifactId>
			<version>INSERTCURRENTVERSION</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.maven</groupId>
			<artifactId>uvms-pom-test-deps</artifactId>
			<version>INSERTCURRENTVERSION</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.maven</groupId>
			<artifactId>uvms-pom-arquillian-deps</artifactId>
			<version>INSERTCURRENTVERSION</version>
			<type>pom</type>
		</dependency>
	</dependencies>
</dependencyManagement>

Add common deps dependencies to the modules that need them

Example at https://github.com/UnionVMS/UVMS-MovementModule-APP/blob/dev/domain/pom.xml .

<dependencies>
	<dependency>
		<groupId>${project.groupId}</groupId>
		<artifactId>movement-model</artifactId>
		<classifier>date</classifier>
	</dependency>
	<dependency>
		<groupId>fish.focus.uvms.maven</groupId>
		<artifactId>uvms-pom-gis-deps</artifactId>
		<type>pom</type>
	</dependency>
	<dependency>
		<groupId>fish.focus.uvms.maven</groupId>
		<artifactId>uvms-pom-monitoring-deps</artifactId>
		<type>pom</type>
	</dependency>
	<dependency>
		<groupId>fish.focus.uvms.maven</groupId>
		<artifactId>uvms-pom-test-deps</artifactId>
		<type>pom</type>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>fish.focus.uvms.maven</groupId>
		<artifactId>uvms-pom-arquillian-deps</artifactId>
		<type>pom</type>
		<scope>test</scope>
	</dependency>
</dependencies>


Configure docker settings and when to start, stop docker.

The docker profile defined in the parent-pom starts up the activemq,postgres-release and wildfly-base docker containers.
When using docker you have a two options development or ci mode.

Docker properties

Default Docker settings in uvms-pom.

<docker.dev.version>SOME_VERSION(3.2.0)</docker.dev.version>
<docker.dev.start.phase>none</docker.dev.start.phase>
<docker.dev.stop.phase>none</docker.dev.stop.phase>
<docker.dev.prestop.phase>none</docker.dev.prestop.phase>

In the first module that uses docker you need to set it to start during test-compile phases and also to make sure no other containers are running in validate phase.

<docker.dev.start.phase>test-compile</docker.dev.start.phase>
<docker.dev.prestop.phase>validate</docker.dev.prestop.phase>

And in the last module that uses docker you need to set it to stop

<docker.dev.stop.phase>verify</docker.dev.stop.phase>
<docker.dev.prestop.phase>install</docker.dev.prestop.phase>                                      

Development mode

Works well when you start the docker containers and run your test multiple times in your IDE during development.
(you start/stop docker manually)

#Start (in your root project)
mvn install -Pdocker,docker-start –N

#Stop (in your root project)
mvn install -Pdocker,docker-stop –N

Ci mode

Build and test all modules using docker

mvn clean install –Pdocker