Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Mock implementations of the DocumentSubmitImpl, DocumentSearchImpl and PatientSearchImpl are provided in the project epsos-ws-server-mock-impl.  These classes simply return dummy responses (not implemented yet).  The mock implementations are packaged as a jar file epsos-ws-server-mock-impl-0.1.0.jar.

Packaging

Each country must build their own jar file containing their own implementations, dependencies and supporting files. This jar file is bundled into the epsos-ws-server.war.  The pom.xml for the epsos-ws-server project uses profiles to achieve this goal.  Maven profiles enable portable build scripts that can be run with with different configurations.

Code Block
languagehtml/xml
	<profiles>
		<profile>
			<!-- This profile bundles a mock National Connector interface -->
			<id>national-connector-mock-impl</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>eu.epsos.protocolterminators.ws.server</groupId>
					<artifactId>epsos-ws-server-mock-impl</artifactId>
					<version>0.1.0</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<!-- This profile bundles the country-specifig National Connector interface -->
			<id>national-connector-impl</id>
			<dependencies>
				<dependency>
					<groupId>${national-connector-interface.groupid}</groupId>
					<artifactId>${national-connector-interface.artifactid}</artifactId>
					<version>${national-connector-interface.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

...

The first profile (activated by default) bundles the mock implementations into the war file.  The second profile will bundle the National implementation.  For this  

 

For the National build to work it is necessary to configure the local build environment with properties.  The  These properties are defined here:

Code Block
languagenone
# build server with mock implementation
mvn clean install
 
# build server with real implementation
mvn clean install -P national-connector-impl

in local configuration files:

Per User

- Defined in the Maven-settings (%USER_HOME%/.m2/settings.xml).

Global

- Defined in the global Maven-settings (%M2_HOME%/conf/settings.xml).

Profile descriptor

- a descriptor located in project basedir (profiles.xml) (unsupported in Maven 3.x)

 

Here are the Maven commands

Code Block
languagenone
# build server with mock implementation
mvn clean install
 
# build server with real implementation
mvn clean install -P national-connector-impl
 

References

Java SE6 ServiceLoader

...